Skip to content

Commit e6abc9c

Browse files
committed
minor #14806 [PHPUnitBridge] Document the deprecation baseline file (javiereguiluz)
This PR was merged into the 5.2 branch. Discussion ---------- [PHPUnitBridge] Document the deprecation baseline file Fixes #14367. I have a question about this: the `baselineFile` must be an absolute path in all cases? Can it be relative to project root? Maybe @alexpott can help us with that question. Thanks! Commits ------- 83af9a1 [PhpUnitBridge] Document the deprecation baseline file
2 parents 7bd75b3 + 83af9a1 commit e6abc9c

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

components/phpunit_bridge.rst

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,36 @@ 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 and encoded in JSON. The file path defined in ``baselineFile`` can
309+
be absolute or relative to your project root.
310+
311+
Then, you can run the following command to use that file and ignore those deprecations:
312+
313+
.. code-block:: terminal
314+
315+
$ SYMFONY_DEPRECATIONS_HELPER='baselineFile=tests/allowed.json' ./vendor/bin/simple-phpunit
316+
317+
.. versionadded:: 5.2
318+
319+
The ``baselineFile`` and ``generateBaseline`` options were introduced in
320+
Symfony 5.2.
321+
292322
Disabling the Verbose Output
293323
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
294324

0 commit comments

Comments
 (0)