Skip to content
This repository was archived by the owner on Jan 30, 2023. It is now read-only.

Commit 25e06c8

Browse files
Nicolas HartGuillermo Lengemann
Nicolas Hart
authored and
Guillermo Lengemann
committed
Remove the deprecated PHPUnit_Extensions_TestDecorator part
1 parent ebfc7b6 commit 25e06c8

File tree

1 file changed

+0
-62
lines changed

1 file changed

+0
-62
lines changed

src/extending-phpunit.rst

Lines changed: 0 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -209,68 +209,6 @@ In :ref:`appendixes.configuration.test-listeners` you can see
209209
how to configure PHPUnit to attach your test listener to the test
210210
execution.
211211

212-
.. _extending-phpunit.PHPUnit_Extensions_TestDecorator:
213-
214-
Subclass PHPUnit_Extensions_TestDecorator
215-
#########################################
216-
217-
You can wrap test cases or test suites in a subclass of
218-
``PHPUnit_Extensions_TestDecorator`` and use the
219-
Decorator design pattern to perform some actions before and after the
220-
test runs.
221-
222-
PHPUnit ships with one concrete test decorator:
223-
``PHPUnit_Extensions_RepeatedTest``. It is used to run a
224-
test repeatedly and only count it as a success if all iterations are
225-
successful.
226-
227-
:numref:`extending-phpunit.examples.RepeatedTest.php`
228-
shows a cut-down version of the ``PHPUnit_Extensions_RepeatedTest``
229-
test decorator that illustrates how to write your own test decorators.
230-
231-
.. code-block:: php
232-
:caption: The RepeatedTest Decorator
233-
:name: extending-phpunit.examples.RepeatedTest.php
234-
235-
<?php
236-
use PHPUnit\Framework\TestCase;
237-
238-
require_once 'PHPUnit/Extensions/TestDecorator.php';
239-
240-
class PHPUnit_Extensions_RepeatedTest extends PHPUnit_Extensions_TestDecorator
241-
{
242-
private $timesRepeat = 1;
243-
244-
public function __construct(PHPUnit_Framework_Test $test, $timesRepeat = 1)
245-
{
246-
parent::__construct($test);
247-
248-
if (is_integer($timesRepeat) &&
249-
$timesRepeat >= 0) {
250-
$this->timesRepeat = $timesRepeat;
251-
}
252-
}
253-
254-
public function count()
255-
{
256-
return $this->timesRepeat * $this->test->count();
257-
}
258-
259-
public function run(PHPUnit_Framework_TestResult $result = null)
260-
{
261-
if ($result === null) {
262-
$result = $this->createResult();
263-
}
264-
265-
for ($i = 0; $i < $this->timesRepeat && !$result->shouldStop(); $i++) {
266-
$this->test->run($result);
267-
}
268-
269-
return $result;
270-
}
271-
}
272-
?>
273-
274212
.. _extending-phpunit.PHPUnit_Framework_Test:
275213

276214
Implement PHPUnit_Framework_Test

0 commit comments

Comments
 (0)