-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove not longer required stubs #309
Remove not longer required stubs #309
Conversation
@@ -10,18 +10,18 @@ | |||
} | |||
], | |||
"require": { | |||
"php": "^7.1 || ^8.0", | |||
"php": "^7.2 || ^8.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
prophecy 1.17 does only support PHPUnit 8, 9 (10 soon). So we can not longer test against 6 and 7.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
phpunit 10 is now supported
edd0cac
to
b08af9e
Compare
b08af9e
to
11a2a9c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
phpunit 10 is now supported
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
@template
with@template-covariant
Since Prophecy 1.17.0 the template are correctly added to prophecy itself and so the stubs are not longer required. Thx to @stof.