Skip to content

Commit 9263103

Browse files
theofidryxabbuh
authored andcommitted
Add mention of the SymfonyTestsListener
1 parent de04468 commit 9263103

File tree

1 file changed

+27
-2
lines changed

1 file changed

+27
-2
lines changed

components/phpunit_bridge.rst

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,28 @@ You can install the component in 2 different ways:
3535

3636
.. include:: /components/require_autoload.rst.inc
3737

38+
39+
If you are using the `Modified PHPUnit script`_ (A.K.A. Simple PHPUnit), then no further step is required. If however
40+
you are using the regular `PHPUnit script`_, then you need to register ``SymfonyTestsListener``
41+
(a `PHPUnit test listener`_):
42+
43+
.. code-block:: xml
44+
45+
<!-- http://phpunit.de/manual/6.0/en/appendixes.configuration.html -->
46+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
47+
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/6.0/phpunit.xsd"
48+
>
49+
50+
<!-- ... -->
51+
52+
<listeners>
53+
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener" />
54+
</listeners>
55+
</phpunit>
56+
57+
.. tip:: 3.1
58+
Note that this step is mandatory only if you plan to `Write Assertions about Deprecations`_.
59+
3860
Usage
3961
-----
4062

@@ -94,9 +116,9 @@ message, enclosed with ``/``. For example, with:
94116

95117
.. code-block:: xml
96118
97-
<!-- http://phpunit.de/manual/4.1/en/appendixes.configuration.html -->
119+
<!-- http://phpunit.de/manual/6.0/en/appendixes.configuration.html -->
98120
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
99-
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.1/phpunit.xsd"
121+
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/6.0/phpunit.xsd"
100122
>
101123
102124
<!-- ... -->
@@ -155,6 +177,7 @@ times (order matters)::
155177
@trigger_error('The second argument of the "Bar" method is deprecated.', E_USER_DEPRECATED);
156178
}
157179

180+
158181
Time-sensitive Tests
159182
--------------------
160183

@@ -401,3 +424,5 @@ If you have installed the bridge through Composer, you can run it by calling e.g
401424
.. _`@-silencing operator`: http://php.net/manual/en/language.operators.errorcontrol.php
402425
.. _`@-silenced`: http://php.net/manual/en/language.operators.errorcontrol.php
403426
.. _`Travis CI`: https://travis-ci.org/
427+
.. _`PHPUnit script`: PHPUnit_
428+
.. _`PHPUnit test listener`: https://phpunit.de/manual/current/en/appendixes.configuration.html#appendixes.configuration.test-listeners

0 commit comments

Comments
 (0)