Skip to content

Commit 53d56b9

Browse files
committed
minor #16768 PHPUnitBridge ignoreFile option (mondrake)
This PR was squashed before being merged into the 6.1 branch. Discussion ---------- PHPUnitBridge ignoreFile option Fixes #16670 Commits ------- 5e18c12 PHPUnitBridge ignoreFile option
2 parents 2d22a4a + 5e18c12 commit 53d56b9

File tree

1 file changed

+34
-4
lines changed

1 file changed

+34
-4
lines changed

components/phpunit_bridge.rst

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -289,13 +289,43 @@ 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+
Ignore Deprecations
293+
...................
294+
295+
.. versionadded:: 6.1
296+
297+
The ``ignoreFile`` feature was introduced in Symfony 6.1.
298+
299+
If your application has some deprecations that you can't fix for some reasons,
300+
you can tell Symfony to ignore them.
301+
302+
You need first to create a simple text file with a list of ignore patterns. Each
303+
pattern is a regular expression.
304+
305+
Lines beginning with an hash (#) will be considered comments:
306+
307+
.. code-block:: terminal
308+
309+
# This file contains patterns to be ignored while testing for use of
310+
# deprecated code.
311+
312+
%The "Symfony\\Component\\Validator\\Context\\ExecutionContextInterface::.*\(\)" method is considered internal Used by the validator engine\. (Should not be called by user\W+code\. )?It may change without further notice\. You should not extend it from "[^"]+"\.%
313+
%The "PHPUnit\\Framework\\TestCase::addWarning\(\)" method is considered internal%
314+
315+
Then, you can run the following command to use that file and ignore those deprecations:
316+
317+
.. code-block:: terminal
318+
319+
$ SYMFONY_DEPRECATIONS_HELPER='ignoreFile=./tests/baseline-ignore' ./vendor/bin/simple-phpunit
320+
292321
Baseline Deprecations
293322
.....................
294323

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 ignored but the rest of deprecations are still reported.
324+
You can also take a snapshot of deprecations currently triggered by your application
325+
code, and ignore those during your test runs, still reporting newly added ones.
326+
The trick is to create a file with the allowed deprecations and define it as the
327+
"deprecation baseline". Deprecations inside that file are ignored but the rest of
328+
deprecations are still reported.
299329

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

0 commit comments

Comments
 (0)