Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Fixed the explanation about PHPUnit event listeners in PHPUnitBridge #8127

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 2 commits into from
Closed
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
29 changes: 25 additions & 4 deletions 29 components/phpunit_bridge.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,16 @@ 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, 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:: terminal

$ cd my-project/
$ ./vendor/bin/simple-phpunit

After running your PHPUnit tests, you will get a report similar to this one:

.. image:: /_images/components/phpunit_bridge/report.png

Expand All @@ -57,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

<!-- phpunit.xml.dist -->
<!-- ... -->
<listeners>
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener" />
</listeners>

Trigger Deprecation Notices
---------------------------

Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.