Remove not longer required stubs#309
Remove not longer required stubs#309alexander-schranz wants to merge 1 commit intoJan0707:masterfrom
Conversation
| ], | ||
| "require": { | ||
| "php": "^7.1 || ^8.0", | ||
| "php": "^7.2 || ^8.0", |
There was a problem hiding this comment.
the stubs are added in 1.17.0 which only supports version from ^7.2 so we not longer can test on 7.1
|
Would you be interested in #285? |
|
@localheinz Sure it looks like it is not a lot of work todo here and I'm if some issue appear it looks like I'm already the first one stumble over it as I use prophecy with the plugin in most projects. |
| "phpspec/prophecy": "^1.7.0", | ||
| "phpunit/phpunit": "^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0" | ||
| "phpspec/prophecy": "^1.17.0", | ||
| "phpunit/phpunit": "^8.0.0 || ^9.0.0" |
There was a problem hiding this comment.
prophecy 1.17 does only support PHPUnit 8, 9 (10 soon). So we can not longer test against 6 and 7.
edd0cac to
b08af9e
Compare
b08af9e to
11a2a9c
Compare
stof
left a comment
There was a problem hiding this comment.
I'm actually wondering whether this extension is still needed at all. Prophecy also has generic signatures for prophesize() methods
| "phpspec/prophecy": "^1.7.0", | ||
| "phpunit/phpunit": "^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0" | ||
| "phpspec/prophecy": "^1.17.0", | ||
| "phpunit/phpunit": "^8.0.0 || ^9.0.0" |
I verified this and there is it still doesn't work without the extension (PHP 8.2, PhpUnit 10, phpstan 1.10). Test case: final class SimpleProphecyTestCase extends TestCase
{
use ProphecyTrait;
public function testCreatedViaTrait(): void
{
$foo = $this->prophesize(Foo::class);
$foo->foo()->willReturn('foo');
$foo = $foo->reveal();
self::assertSame('foo', $foo->foo());
}
public function testCreatedInline(): void
{
$foo = (new Prophet())->prophesize(Foo::class);
$foo->foo()->willReturn('foo');
$foo = $foo->reveal();
self::assertSame('foo', $foo->foo());
}
}
class Foo
{
public function foo(): string
{
return 'foo';
}
}Output: ------ -----------------------------------------------------------------------------------
Line SimpleProphecyTestCase.php
------ -----------------------------------------------------------------------------------
20 Call to an undefined method Prophecy\Prophecy\ObjectProphecy::foo().
27 Call to an undefined method Prophecy\Prophecy\ObjectProphecy<AppTest\Foo>::foo().
------ -----------------------------------------------------------------------------------To make dynamic return types working Note that method in It seems this extension is still required. |
Two answers to this question.
|
|
ah indeed. I forgot the part covering the magic calls. But I think WillExtendOrImplementDynamicReturnTypeExtension and ProphesizeDynamicReturnTypeExtension are not needed anymore.
this should be solved by doing a PR on the prophecy-phpunit repo IMO. |
Obviously. :) |
|
And the TypeNodeResolverExtension should probably be deprecated because it is about transforming types like |
|
Actually, I just did the PR for the ProphecyTrait myself: phpspec/prophecy-phpunit#63 |
|
close in favor of #348 where we removed the not longer required stubs |
This pull request replaces #298 which did replacer
@templatewith@template-covariantSince Prophecy 1.17.0 the template are correctly added to prophecy itself and so the stubs are not longer required. Thx to @stof.