Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature #22668 [FrameworkBundle] KernelTestCase: allow to provide the…
… kernel class with a var (ogizanagi) This PR was merged into the 3.3-dev branch. Discussion ---------- [FrameworkBundle] KernelTestCase: allow to provide the kernel class with a var | Q | A | ------------- | --- | Branch? | 3.3 | Bug fix? | no | New feature? | yes, but must-have for the new project structure when using flex | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #22661 | License | MIT | Doc PR | todo in https://symfony.com/doc/current/testing.html#your-first-functional-test So, when using flex, the new `phpunit.xml.dist` will be: ```diff <?xml version="1.0" encoding="UTF-8"?> <!-- https://phpunit.de/manual/current/en/appendixes.configuration.html --> <phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/6.1/phpunit.xsd" backupGlobals="false" colors="true" bootstrap="vendor/autoload.php" > <php> <ini name="error_reporting" value="-1" /> - <server name="KERNEL_DIR" value="etc/" /> + <server name="KERNEL_CLASS" value="App\Kernel" /> </php> <testsuites> <testsuite name="Project Test Suite"> <directory>tests/</directory> </testsuite> </testsuites> </phpunit> ``` As it may cause issues when refactoring, I added a `class_exists` check with an appropriate exception to indicate the class is either not found or not autoloadable. Commits ------- 4f68912 [FrameworkBundle] KernelTestCase: allow to provide the kernel class with a var
- Loading branch information