From fe063c6b77526ebf2f2d684eba45c5b716ed2fb2 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Fri, 6 Jan 2017 12:40:00 +0100 Subject: [PATCH] clarify silencing deprecations in tests --- components/phpunit_bridge.rst | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/components/phpunit_bridge.rst b/components/phpunit_bridge.rst index dc556c72d2c..a852bd748bf 100644 --- a/components/phpunit_bridge.rst +++ b/components/phpunit_bridge.rst @@ -73,15 +73,25 @@ in the **Unsilenced** section of the deprecation report. Mark Tests as Legacy -------------------- -There are four ways to mark a test as legacy: +There are three ways to mark a test as legacy: * (**Recommended**) Add the ``@group legacy`` annotation to its class or method; * Make its class name start with the ``Legacy`` prefix; -* Make its method name start with ``testLegacy*()`` instead of ``test*()``; +* Make its method name start with ``testLegacy*()`` instead of ``test*()``. -* Make its data provider start with ``provideLegacy*()`` or ``getLegacy*()``. +.. note:: + + If your data provider calls code that would usually trigger a deprecation, + you can prefix its name with ``provideLegacy`` or ``getLegacy`` to silent + these deprecations. If your data provider does not execute deprecated + code, it is not required to choose a special naming just because the + test being fed by the data provider is marked as legacy. + + Also be aware that choosing one of the two legacy prefixes will not mark + tests as legacy that make use of this data provider. You still have to + mark them as legacy tests explicitly. Configuration -------------