8000 minor #11899 [Testing] Fix wrong include in custom bootstrap for test… · xavierleune/symfony-docs@08526cf · GitHub
[go: up one dir, main page]

Skip to content

Commit 08526cf

Browse files
committed
minor symfony#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
2 parents 8e80991 + f34bd0b commit 08526cf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

testing/bootstrap.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ To do this, first add a file that executes your bootstrap work::
1818
));
1919
}
2020

21-
require __DIR__.'/../vendor/autoload.php';
21+
require __DIR__.'/../config/bootstrap.php';
2222

2323
Then, configure ``phpunit.xml.dist`` to execute this ``bootstrap.php`` file
2424
before running the tests:

0 commit comments

Comments
 (0)
0