From ba6404207de24da4ef686c7af744f83553b3dcf8 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Thu, 6 Jul 2017 12:44:43 +0200 Subject: [PATCH 1/2] Fixed the explanation about PHPUnit event listeners in PHPUnitBridge --- components/phpunit_bridge.rst | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/components/phpunit_bridge.rst b/components/phpunit_bridge.rst index 0200143c737..477d3d78f48 100644 --- a/components/phpunit_bridge.rst +++ b/components/phpunit_bridge.rst @@ -37,10 +37,19 @@ You can install the component in 2 different ways: Usage ----- -Once the component is installed, it automatically registers a -`PHPUnit event listener`_ which in turn registers a `PHP error handler`_ -called :class:`Symfony\\Bridge\\PhpUnit\\DeprecationErrorHandler`. After -running your PHPUnit tests, you will get a report similar to this one: +Once the component is installed, register the following `PHPUnit event listener`_ +in your PHPUnit configuration file, which in turn registers a `PHP error handler`_ +called :class:`Symfony\\Bridge\\PhpUnit\\DeprecationErrorHandler`: + +.. code-block:: xml + + + + + + + +After running your PHPUnit tests, you will get a report similar to this one: .. image:: /_images/components/phpunit_bridge/report.png From 2d45bc24cd22288c5cae4acf4063b8d1454e4623 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Mon, 10 Jul 2017 08:55:01 +0200 Subject: [PATCH 2/2] Reworded the explanation --- components/phpunit_bridge.rst | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/components/phpunit_bridge.rst b/components/phpunit_bridge.rst index 477d3d78f48..43254312fe2 100644 --- a/components/phpunit_bridge.rst +++ b/components/phpunit_bridge.rst @@ -37,17 +37,14 @@ You can install the component in 2 different ways: Usage ----- -Once the component is installed, register the following `PHPUnit event listener`_ -in your PHPUnit configuration file, which in turn registers a `PHP error handler`_ -called :class:`Symfony\\Bridge\\PhpUnit\\DeprecationErrorHandler`: +Once the component is installed, a ``simple-phpunit`` script is created in the +``vendor/`` directory to run tests. This script wraps the original PHPUnit binary +to provide more features: -.. code-block:: xml +.. code-block:: terminal - - - - - + $ cd my-project/ + $ ./vendor/bin/simple-phpunit After running your PHPUnit tests, you will get a report similar to this one: @@ -66,6 +63,21 @@ The summary includes: Deprecation notices are all other (non-legacy) notices, grouped by message, test class and method. +.. note:: + + If you don't want to use the ``simple-phpunit`` script, register the following + `PHPUnit event listener`_ in your PHPUnit configuration file to get the same + report about deprecations (which is created by a `PHP error handler`_ + called :class:`Symfony\\Bridge\\PhpUnit\\DeprecationErrorHandler`): + + .. code-block:: xml + + + + + + + Trigger Deprecation Notices ---------------------------