diff --git a/doctrine.rst b/doctrine.rst index 866301f50aa..4e5b786b554 100644 --- a/doctrine.rst +++ b/doctrine.rst @@ -539,7 +539,7 @@ and injected by the dependency injection container:: class ProductController extends AbstractController { #[Route('/product/{id}', name: 'product_show')] - public function show(int $id, ProductRepository $productRepository): Response + public function show(ProductRepository $productRepository, int $id): Response { $product = $productRepository ->find($id); diff --git a/testing/bootstrap.rst b/testing/bootstrap.rst index c075552a9e3..59fc289f0be 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:: @@ -49,21 +47,5 @@ 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.