You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
minor #11899 [Testing] Fix wrong include in custom bootstrap for tests (gregurco)
This PR was merged into the 4.3 branch.
Discussion
----------
[Testing] Fix wrong include in custom bootstrap for tests
Hello.
There is a wrong include in custom `tests/bootstrap.php` for tests. Till 4.3 it was ok, but from 4.3 following the article you will receive next error:
```
LogicException: You must set the KERNEL_CLASS environment variable to the fully-qualified class name of your Kernel in phpunit.xml / phpunit.xml.dist or override the App\Tests\Foo\BarTest::createKernel() or App\Tests\Foo\BaTest::getKernelClass() method.
```
The problem exists, because the sequence of bootstrap is changes:
`phpunit.dist.xml -> config/bootstrap.php -> vendor/autoload.php`
and normally if something is injected in phpunit config, it should respect the sequence:
`phpunit.dist.xml -> tests/bootstrap.php (CUSTOM) -> config/bootstrap.php -> vendor/autoload.php`
Actual state in documentation (wrong one)
`phpunit.dist.xml -> tests/bootstrap.php -> vendor/autoload.php`
Red to recipe: https://github.com/symfony/recipes/blob/master/phpunit/phpunit/4.7/phpunit.xml.dist#L8
Thanks, Vlad.
Commits
-------
f34bd0b Fix wrong include in custom bootstrap for tests
0 commit comments