From 753e0d23702ad3e7ee5667f089cd026c246af48c Mon Sep 17 00:00:00 2001 From: Ludovic REUS Date: Mon, 8 Oct 2018 15:49:39 +0200 Subject: [PATCH 1/2] Fix phpunit command replace ./bin/phpunit with ./vendor/bin/simple-phpunit --- testing.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/testing.rst b/testing.rst index 8d005362ff7..35d37cf59d2 100644 --- a/testing.rst +++ b/testing.rst @@ -29,7 +29,7 @@ command: .. code-block:: terminal - $ ./bin/phpunit + $ ./vendor/bin/simple-phpunit PHPUnit is configured by the ``phpunit.xml.dist`` file in the root of your Symfony application. @@ -101,13 +101,13 @@ Running tests for a given file or directory is also very easy: .. code-block:: terminal # run all tests of the application - $ ./bin/phpunit + $ ./vendor/bin/simple-phpunit # run all tests in the Util/ directory - $ ./bin/phpunit tests/Util + $ ./vendor/bin/simple-phpunit tests/Util # run tests for the Calculator class - $ ./bin/phpunit tests/Util/CalculatorTest.php + $ ./vendor/bin/simple-phpunit tests/Util/CalculatorTest.php .. index:: single: Tests; Functional tests From 10a22d595ab2fde2ce78ca948dbf19921d9e0232 Mon Sep 17 00:00:00 2001 From: Ludovic REUS Date: Thu, 11 Oct 2018 14:56:38 +0200 Subject: [PATCH 2/2] Add note about potentially missing phpunit command Revert phpunit command to ./bin/phpunit Add a note explaining that ./bin/phpunit can be missing if PhPUnitBridge recipes did not run and provide a workaround to fix the problem --- testing.rst | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/testing.rst b/testing.rst index 35d37cf59d2..045f532e972 100644 --- a/testing.rst +++ b/testing.rst @@ -29,7 +29,24 @@ command: .. code-block:: terminal - $ ./vendor/bin/simple-phpunit + $ ./bin/phpunit + +.. note:: + + If your project is missing the phpunit command in the ./bin directory, Symfony + may have not executed the required PhPUnitBridge recipes. This may occurs when + the bundle symfony/phpunit-bridge is part of your composer.json file and your + starting project contains a symfony.lock file. + + Two options can be used to fix that problem: + + * Remove the symfony.lock file before doing the first ``composer install`` + * Remove and require again the symfony/phpunit-bridge bundle: + +.. code-block:: terminal + + $ composer remove symfony/phpunit-bridge + $ composer require --dev symfony/phpunit-bridge PHPUnit is configured by the ``phpunit.xml.dist`` file in the root of your Symfony application. @@ -101,13 +118,13 @@ Running tests for a given file or directory is also very easy: .. code-block:: terminal # run all tests of the application - $ ./vendor/bin/simple-phpunit + $ ./bin/phpunit # run all tests in the Util/ directory - $ ./vendor/bin/simple-phpunit tests/Util + $ ./bin/phpunit tests/Util # run tests for the Calculator class - $ ./vendor/bin/simple-phpunit tests/Util/CalculatorTest.php + $ ./bin/phpunit tests/Util/CalculatorTest.php .. index:: single: Tests; Functional tests