From 45d27d49e20c87da1b4bc6f3294c28bebc96b536 Mon Sep 17 00:00:00 2001 From: Nicolas Hart Date: Fri, 16 Mar 2018 09:34:52 +0100 Subject: [PATCH] Remove the deprecated PHPUnit_Extensions_TestDecorator part --- src/extending-phpunit.rst | 62 --------------------------------------- 1 file changed, 62 deletions(-) diff --git a/src/extending-phpunit.rst b/src/extending-phpunit.rst index 8209eed1..f85c77ec 100644 --- a/src/extending-phpunit.rst +++ b/src/extending-phpunit.rst @@ -209,68 +209,6 @@ In :ref:`appendixes.configuration.test-listeners` you can see how to configure PHPUnit to attach your test listener to the test execution. -.. _extending-phpunit.PHPUnit_Extensions_TestDecorator: - -Subclass PHPUnit_Extensions_TestDecorator -######################################### - -You can wrap test cases or test suites in a subclass of -``PHPUnit_Extensions_TestDecorator`` and use the -Decorator design pattern to perform some actions before and after the -test runs. - -PHPUnit ships with one concrete test decorator: -``PHPUnit_Extensions_RepeatedTest``. It is used to run a -test repeatedly and only count it as a success if all iterations are -successful. - -:numref:`extending-phpunit.examples.RepeatedTest.php` -shows a cut-down version of the ``PHPUnit_Extensions_RepeatedTest`` -test decorator that illustrates how to write your own test decorators. - -.. code-block:: php - :caption: The RepeatedTest Decorator - :name: extending-phpunit.examples.RepeatedTest.php - - = 0) { - $this->timesRepeat = $timesRepeat; - } - } - - public function count() - { - return $this->timesRepeat * $this->test->count(); - } - - public function run(PHPUnit_Framework_TestResult $result = null) - { - if ($result === null) { - $result = $this->createResult(); - } - - for ($i = 0; $i < $this->timesRepeat && !$result->shouldStop(); $i++) { - $this->test->run($result); - } - - return $result; - } - } - ?> - .. _extending-phpunit.PHPUnit_Framework_Test: Implement PHPUnit_Framework_Test