-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[HttpKernel] do not use the Test suffix for non test classes #58362
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
Conversation
Q | A |
---|---|
Branch? | 7.2 |
Bug fix? | no |
New feature? | no |
Deprecations? | no |
Issues | |
License | MIT |
38a7c31
to
d04d1f4
Compare
d04d1f4
to
7ad8ed8
Compare
@@ -661,3 +659,51 @@ public function process(ContainerBuilder $container): void | |||
$container->setParameter('test.processed', true); | |||
} | |||
} | |||
|
|||
class KernelForTest extends Kernel |
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.
Don't we still have the issue as we still have the Test suffix here ?
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.
That doesn't matter as the file is named KernelTest.php
. Thus PHPUnit searches for a test named KernelTest
.
Here is how it looks in practice without the changes with PHPUnit 11:
PHPUnit 11.3.5 by Sebastian Bergmann and contributors.
Runtime: PHP 8.3.9
Configuration: /Users/christianflothmann/symfony/phpunit.xml.dist
............................................................. 61 / 1293 ( 4%)
............................................................. 122 / 1293 ( 9%)
............................................................. 183 / 1293 ( 14%)
............................................................. 244 / 1293 ( 18%)
............................................................. 305 / 1293 ( 23%)
............................................................. 366 / 1293 ( 28%)
............................................................. 427 / 1293 ( 33%)
............................................................. 488 / 1293 ( 37%)
............................................................. 549 / 1293 ( 42%)
..................................................R.......... 610 / 1293 ( 47%)
............................................................. 671 / 1293 ( 51%)
............................................................. 732 / 1293 ( 56%)
............................................................. 793 / 1293 ( 61%)
............................................................. 854 / 1293 ( 66%)
............................................................. 915 / 1293 ( 70%)
............................................................. 976 / 1293 ( 75%)
............................................................. 1037 / 1293 ( 80%)
............................................................. 1098 / 1293 ( 84%)
............................................................. 1159 / 1293 ( 89%)
............................................................. 1220 / 1293 ( 94%)
............................................................. 1281 / 1293 ( 99%)
............ 1293 / 1293 (100%)
Time: 00:05.271, Memory: 87.27 MB
There was 1 PHPUnit test runner warning:
1) Class Symfony\Component\HttpKernel\Tests\Fixtures\KernelForTest declared in /Users/christianflothmann/symfony/src/Symfony/Component/HttpKernel/Tests/Fixtures/KernelForTest.php does not extend PHPUnit\Framework\TestCase
--
There was 1 risky test:
1) Symfony\Component\HttpKernel\Tests\EventListener\RouterListenerTest::testWithBadRequest
Test code or tested code did not remove its own exception handlers
And this is how it is with the changes being done here:
PHPUnit 11.3.5 by Sebastian Bergmann and contributors.
Runtime: PHP 8.3.9
Configuration: /Users/christianflothmann/symfony/phpunit.xml.dist
............................................................. 61 / 1293 ( 4%)
............................................................. 122 / 1293 ( 9%)
............................................................. 183 / 1293 ( 14%)
............................................................. 244 / 1293 ( 18%)
............................................................. 305 / 1293 ( 23%)
............................................................. 366 / 1293 ( 28%)
............................................................. 427 / 1293 ( 33%)
............................................................. 488 / 1293 ( 37%)
............................................................. 549 / 1293 ( 42%)
..................................................R.......... 610 / 1293 ( 47%)
............................................................. 671 / 1293 ( 51%)
............................................................. 732 / 1293 ( 56%)
............................................................. 793 / 1293 ( 61%)
............................................................. 854 / 1293 ( 66%)
............................................................. 915 / 1293 ( 70%)
............................................................. 976 / 1293 ( 75%)
............................................................. 1037 / 1293 ( 80%)
............................................................. 1098 / 1293 ( 84%)
............................................................. 1159 / 1293 ( 89%)
............................................................. 1220 / 1293 ( 94%)
............................................................. 1281 / 1293 ( 99%)
............ 1293 / 1293 (100%)
Time: 00:05.250, Memory: 87.27 MB
There was 1 risky test:
1) Symfony\Component\HttpKernel\Tests\EventListener\RouterListenerTest::testWithBadRequest
Test code or tested code did not remove its own exception handlers
Thank you @xabbuh. |