-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Check that we are not using features deprecated in PHPUnit 8 #30055
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
Comments
First reports running my own test suite, related to simple-phpunit:
|
Yep, |
@Pierstoval with the exception of downgrading, is there a workaround for this? Any idea? |
Well, with this thing about variance & co, it seems we can already add the class A {
protected function tearDown()
{
}
}
class B extends A {
protected function tearDown(): void // Works
{
}
} |
Yes, the return type can already be added to existing tests. However, we cannot do this in the 3.4 branch as we need to support php 5 there. The consequence is that the Symfony 3.4 test suite will be incompatible with PHPUnit 8 forever. But this is fine, I guess. On the other hand, if we fix this in 4.2/master only, changes to the 3.4 test suite will cause more conflicts when merging them to 4.2/master. |
PHPUnit Bridge uses the deprecated |
see also #30071 |
Alternatively: We could rename all |
Regarding
|
I think we should focus on the bridge only for now as that's the blocking part - as a bug fix if possible. |
The blocking part would be that we cannot extend PHPUnit's test runner anymore. That class is final now. If I simply alias Symfony's test runner to PHPUnit's default one, my project test suites work again. I must admit, I don't fully understand the purpose of that extended test runner, so I'm having a hard time finding a replacement for it. |
Its purpose is to automatically register the |
Can't we do this in the |
Maybe helpfull I used the following regex to upgrade our phpunit tests to 6.5 some time ago: setExpectedException \n( \* )@expectExceptionMessage (.*?)(\n)([\s\S^?]+?)(\{)
$3$4$5\n \$this->expectExceptionMessage(\'$2\');
\n( \* )@expectException (.*?)(\n)([\s\S^?]+?)(\{)
$3$4$5\n \$this->expectException($2::class); Some other regex can be found here: sulu/sulu#3931 |
@nicolas-grekas @derrabus not the best way but as the bridge itself installed a modified version of the phpunit we could just remove the final 🙈 : #30085 |
This PR was squashed before being merged into the 3.4 branch (closes #30085). Discussion ---------- Fix TestRunner compatibility to PhpUnit 8 | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | related to: #30055 | License | MIT | Doc PR | - Modify the installed phpunit version to be compatibility with the symfony custom TestRunner. This is sure not the best way but maybe currently the fastest way to support PhpUnit 8. The hack should be removed as soon as there is another way to implement a custom Runner. Commits ------- a0c66a3 Fix TestRunner compatibility to PhpUnit 8
Let's close this because it's not very actionable and because we're already working continuously on our test suite, so we won't miss a single change or deprecation. Thanks. |
Description
PHPUnit 8 has just been released. In addition to new features, the following has been deprecated and will be removed in PHPUnit 9:
assertInternalType()
andassertNotInternalType()
assertArraySubset()
assertEquals()
andassertNotEquals()
TestListener
interfaceassertContains()
andassertNotContains()
as well as using these methods with string haystacksFull details at https://phpunit.de/announcements/phpunit-8.html
Let's review our tests to make sure we don't use these. Thanks.
The text was updated successfully, but these errors were encountered: