Skip to content

Commit 2d29c07

Browse files
committed
minor #7323 [PhpUnitBridge] clarify silencing deprecations in tests (xabbuh)
This PR was merged into the 2.7 branch. Discussion ---------- [PhpUnitBridge] clarify silencing deprecations in tests This resolves #7312. Commits ------- fe063c6 clarify silencing deprecations in tests
2 parents 4d3483d + fe063c6 commit 2d29c07

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

components/phpunit_bridge.rst

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,15 +94,25 @@ in the **Unsilenced** section of the deprecation report.
9494
Mark Tests as Legacy
9595
--------------------
9696

97-
There are four ways to mark a test as legacy:
97+
There are three ways to mark a test as legacy:
9898

9999
* (**Recommended**) Add the ``@group legacy`` annotation to its class or method;
100100

101101
* Make its class name start with the ``Legacy`` prefix;
102102

103-
* Make its method name start with ``testLegacy*()`` instead of ``test*()``;
103+
* Make its method name start with ``testLegacy*()`` instead of ``test*()``.
104104

105-
* Make its data provider start with ``provideLegacy*()`` or ``getLegacy*()``.
105+
.. note::
106+
107+
If your data provider calls code that would usually trigger a deprecation,
108+
you can prefix its name with ``provideLegacy`` or ``getLegacy`` to silent
109+
these deprecations. If your data provider does not execute deprecated
110+
code, it is not required to choose a special naming just because the
111+
test being fed by the data provider is marked as legacy.
112+
113+
Also be aware that choosing one of the two legacy prefixes will not mark
114+
tests as legacy that make use of this data provider. You still have to
115+
mark them as legacy tests explicitly.
106116

107117
Configuration
108118
-------------

0 commit comments

Comments
 (0)