Skip to content

Commit fe063c6

Browse files
committed
clarify silencing deprecations in tests
1 parent 2d1c269 commit fe063c6

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

components/phpunit_bridge.rst

+13-3
Original file line numberDiff line numberDiff line change
@@ -73,15 +73,25 @@ in the **Unsilenced** section of the deprecation report.
7373
Mark Tests as Legacy
7474
--------------------
7575

76-
There are four ways to mark a test as legacy:
76+
There are three ways to mark a test as legacy:
7777

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

8080
* Make its class name start with the ``Legacy`` prefix;
8181

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

84-
* Make its data provider start with ``provideLegacy*()`` or ``getLegacy*()``.
84+
.. note::
85+
86+
If your data provider calls code that would usually trigger a deprecation,
87+
you can prefix its name with ``provideLegacy`` or ``getLegacy`` to silent
88+
these deprecations. If your data provider does not execute deprecated
89+
code, it is not required to choose a special naming just because the
90+
test being fed by the data provider is marked as legacy.
91+
92+
Also be aware that choosing one of the two legacy prefixes will not mark
93+
tests as legacy that make use of this data provider. You still have to
94+
mark them as legacy tests explicitly.
8595

8696
Configuration
8797
-------------

0 commit comments

Comments
 (0)