diff --git a/testing/bootstrap.rst b/testing/bootstrap.rst index c075552a9e3..55d567df6aa 100644 --- a/testing/bootstrap.rst +++ b/testing/bootstrap.rst @@ -25,14 +25,12 @@ You can modify this file to add custom logic: (new Dotenv())->bootEnv(dirname(__DIR__).'/.env'); } - + if (isset($_ENV['BOOTSTRAP_CLEAR_CACHE_ENV'])) { - + // executes the "php bin/console cache:clear" command - + passthru(sprintf( - + 'APP_ENV=%s php "%s/../bin/console" cache:clear --no-warmup', - + $_ENV['BOOTSTRAP_CLEAR_CACHE_ENV'], - + __DIR__ - + )); - + } + + // executes the "php bin/console cache:clear" command + + passthru(sprintf( + + 'APP_ENV=%s php "%s/../bin/console" cache:clear --no-warmup', + + $_ENV['APP_ENV'], + + __DIR__ + + )); .. note:: @@ -48,22 +46,3 @@ You can modify this file to add custom logic: > - -Now, you can update the ``phpunit.xml.dist`` file to declare the custom -environment variable introduced to ``tests/bootstrap.php``: - -.. code-block:: xml - - - - - - - - - - - - -Now, when running ``vendor/bin/phpunit``, the cache will be cleared -automatically by the bootstrap file before running all tests.