Skip to content

Commit 876f927

Browse files
committed
Merge branch '5.2' into 5.x
* 5.2: [PhpUnitBridge] Document the deprecation baseline file
2 parents 756d0b5 + b703a22 commit 876f927

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

components/phpunit_bridge.rst

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,35 @@ Here is a summary that should help you pick the right configuration:
289289
| | cannot afford to use one of the modes above. |
290290
+------------------------+-----------------------------------------------------+
291291

292+
Baseline Deprecations
293+
.....................
294+
295+
If your application has some deprecations that you can't fix for some reasons,
296+
you can tell Symfony to ignore them. The trick is to create a file with the
297+
allowed deprecations and define it as the "deprecation baseline". Deprecations
298+
inside that file are ignore but the rest of deprecations are still reported.
299+
300+
First, generate the file with the allowed deprecations (run the same command
301+
whenever you want to update the existing file):
302+
303+
.. code-block:: terminal
304+
305+
$ SYMFONY_DEPRECATIONS_HELPER='generateBaseline=true&baselineFile=./tests/allowed.json' ./vendor/bin/simple-phpunit
306+
307+
This command stores all the deprecations reported while running tests in the
308+
given file path and encoded in JSON.
309+
310+
Then, you can run the following command to use that file and ignore those deprecations:
311+
312+
.. code-block:: terminal
313+
314+
$ SYMFONY_DEPRECATIONS_HELPER='baselineFile=./tests/allowed.json' ./vendor/bin/simple-phpunit
315+
316+
.. versionadded:: 5.2
317+
318+
The ``baselineFile`` and ``generateBaseline`` options were introduced in
319+
Symfony 5.2.
320+
292321
Disabling the Verbose Output
293322
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
294323

0 commit comments

Comments
 (0)