Skip to content

[PHPUnitBridge] Document the deprecation baseline file #14806

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

Merged
merged 1 commit into from
Jan 22, 2021
Merged
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
30 changes: 30 additions & 0 deletions components/phpunit_bridge.rst
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,36 @@ Here is a summary that should help you pick the right configuration:
| | cannot afford to use one of the modes above. |
+------------------------+-----------------------------------------------------+

Baseline Deprecations
.....................

If your application has some deprecations that you can't fix for some reasons,
you can tell Symfony to ignore them. The trick is to create a file with the
allowed deprecations and define it as the "deprecation baseline". Deprecations
inside that file are ignore but the rest of deprecations are still reported.

First, generate the file with the allowed deprecations (run the same command
whenever you want to update the existing file):

.. code-block:: terminal

$ SYMFONY_DEPRECATIONS_HELPER='generateBaseline=true&baselineFile=tests/allowed.json' ./vendor/bin/simple-phpunit

This command stores all the deprecations reported while running tests in the
given file and encoded in JSON. The file path defined in ``baselineFile`` can
be absolute or relative to your project root.

Then, you can run the following command to use that file and ignore those deprecations:

.. code-block:: terminal

$ SYMFONY_DEPRECATIONS_HELPER='baselineFile=tests/allowed.json' ./vendor/bin/simple-phpunit

.. versionadded:: 5.2

The ``baselineFile`` and ``generateBaseline`` options were introduced in
Symfony 5.2.

Disabling the Verbose Output
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down