Skip to content

Prefer placing services before query parameters #18734

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doctrine.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
30 changes: 6 additions & 24 deletions testing/bootstrap.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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::

Expand All @@ -49,21 +47,5 @@ You can modify this file to add custom logic:
<!-- ... -->
</phpunit>

Now, you can update the ``phpunit.xml.dist`` file to declare the custom
environment variable introduced to ``tests/bootstrap.php``:

.. code-block:: xml

<!-- phpunit.xml.dist -->
<?xml version="1.0" encoding="UTF-8" ?>
<phpunit>
<php>
<env name="BOOTSTRAP_CLEAR_CACHE_ENV" value="test"/>
<!-- ... -->
</php>

<!-- ... -->
</phpunit>

Now, when running ``vendor/bin/phpunit``, the cache will be cleared
automatically by the bootstrap file before running all tests.