From ea087fec5e61c815d7f9d97639f6fc7c256552bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20FIDRY?= Date: Tue, 14 Mar 2017 00:44:43 +0000 Subject: [PATCH 1/4] Add mention of the SymfonyTestsListener --- components/phpunit_bridge.rst | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/components/phpunit_bridge.rst b/components/phpunit_bridge.rst index 1ee8d6fb056..995c6561e3f 100644 --- a/components/phpunit_bridge.rst +++ b/components/phpunit_bridge.rst @@ -35,6 +35,28 @@ You can install the component in 2 different ways: .. include:: /components/require_autoload.rst.inc + +If you are using the `Modified PHPUnit script`_ (A.K.A. Simple PHPUnit), then no further step is required. If however +you are using the regular `PHPUnit script`_, then you need to register ``SymfonyTestsListener`` +(a `PHPUnit test listener`_): + +.. code-block:: xml + + + + + + + + + + + +.. tip:: 3.1 + Note that this step is mandatory only if you plan to `Write Assertions about Deprecations`_. + Usage ----- @@ -94,9 +116,9 @@ message, enclosed with ``/``. For example, with: .. code-block:: xml - + @@ -173,6 +195,7 @@ times (order matters):: @trigger_error('The second argument of the "Bar" method is deprecated.', E_USER_DEPRECATED); } + Time-sensitive Tests -------------------- @@ -419,3 +442,5 @@ If you have installed the bridge through Composer, you can run it by calling e.g .. _`@-silencing operator`: http://php.net/manual/en/language.operators.errorcontrol.php .. _`@-silenced`: http://php.net/manual/en/language.operators.errorcontrol.php .. _`Travis CI`: https://travis-ci.org/ +.. _`PHPUnit script`: PHPUnit_ +.. _`PHPUnit test listener`: https://phpunit.de/manual/current/en/appendixes.configuration.html#appendixes.configuration.test-listeners From 191ad418f141a425b3eee5a4654b3fc37e20d10b Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Tue, 14 Mar 2017 08:56:50 +0100 Subject: [PATCH 2/4] Reworded the explanation --- components/phpunit_bridge.rst | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/components/phpunit_bridge.rst b/components/phpunit_bridge.rst index 995c6561e3f..b2adc5cae1a 100644 --- a/components/phpunit_bridge.rst +++ b/components/phpunit_bridge.rst @@ -35,10 +35,9 @@ You can install the component in 2 different ways: .. include:: /components/require_autoload.rst.inc - -If you are using the `Modified PHPUnit script`_ (A.K.A. Simple PHPUnit), then no further step is required. If however -you are using the regular `PHPUnit script`_, then you need to register ``SymfonyTestsListener`` -(a `PHPUnit test listener`_): +If you plan to :ref:`write-assertions-about-deprecations`_ and use the regular +PHPUnit script (not the modified PHPUnit script provided by Symfony), then you +must register a new `test listener`_ called ``SymfonyTestsListener``: .. code-block:: xml @@ -54,9 +53,6 @@ you are using the regular `PHPUnit script`_, then you need to register ``Symfony -.. tip:: 3.1 - Note that this step is mandatory only if you plan to `Write Assertions about Deprecations`_. - Usage ----- @@ -173,6 +169,8 @@ completely disable the deprecation helper. This is useful to make use of the rest of features provided by this component without getting errors or messages related to deprecations. +.. _write-assertions-about-deprecations: + Write Assertions about Deprecations ----------------------------------- @@ -442,5 +440,4 @@ If you have installed the bridge through Composer, you can run it by calling e.g .. _`@-silencing operator`: http://php.net/manual/en/language.operators.errorcontrol.php .. _`@-silenced`: http://php.net/manual/en/language.operators.errorcontrol.php .. _`Travis CI`: https://travis-ci.org/ -.. _`PHPUnit script`: PHPUnit_ -.. _`PHPUnit test listener`: https://phpunit.de/manual/current/en/appendixes.configuration.html#appendixes.configuration.test-listeners +.. _`test listener`: https://phpunit.de/manual/current/en/appendixes.configuration.html#appendixes.configuration.test-listeners From 9cd1a62ea0b53f9fdf22d351e9d6c6837d851a3a Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Tue, 14 Mar 2017 08:57:50 +0100 Subject: [PATCH 3/4] Removed an extra blank line --- components/phpunit_bridge.rst | 1 - 1 file changed, 1 deletion(-) diff --git a/components/phpunit_bridge.rst b/components/phpunit_bridge.rst index b2adc5cae1a..522cad0be9f 100644 --- a/components/phpunit_bridge.rst +++ b/components/phpunit_bridge.rst @@ -193,7 +193,6 @@ times (order matters):: @trigger_error('The second argument of the "Bar" method is deprecated.', E_USER_DEPRECATED); } - Time-sensitive Tests -------------------- From 21fdfc3fcab7b05a9247644873a6d41eb5b59760 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Tue, 14 Mar 2017 10:03:39 +0100 Subject: [PATCH 4/4] Fixed the issues reported by reviewers --- components/phpunit_bridge.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/phpunit_bridge.rst b/components/phpunit_bridge.rst index 522cad0be9f..62de07cfd40 100644 --- a/components/phpunit_bridge.rst +++ b/components/phpunit_bridge.rst @@ -35,9 +35,9 @@ You can install the component in 2 different ways: .. include:: /components/require_autoload.rst.inc -If you plan to :ref:`write-assertions-about-deprecations`_ and use the regular -PHPUnit script (not the modified PHPUnit script provided by Symfony), then you -must register a new `test listener`_ called ``SymfonyTestsListener``: +If you plan to :ref:`write-assertions-about-deprecations` and use the regular +PHPUnit script (not the modified PHPUnit script provided by Symfony), you have +to register a new `test listener`_ called ``SymfonyTestsListener``: .. code-block:: xml