Permalink
Browse files

- Merge [1210].

  • Loading branch information...
1 parent a3dfd3b commit 3b9531da2baefaa6d59b67c3c139fdf503507608 @sebastianbergmann committed Sep 2, 2007
Showing with 19 additions and 4 deletions.
  1. +16 −3 PHPUnit/Extensions/RepeatedTest.php
  2. +3 −1 PHPUnit/TextUI/TestRunner.php
@@ -65,6 +65,12 @@
class PHPUnit_Extensions_RepeatedTest extends PHPUnit_Extensions_TestDecorator
{
/**
+ * @var mixed
+ * @access private
+ */
+ private $filter = FALSE;
+
+ /**
* @var integer
* @access private
*/
@@ -74,11 +80,12 @@ class PHPUnit_Extensions_RepeatedTest extends PHPUnit_Extensions_TestDecorator
* Constructor.
*
* @param PHPUnit_Framework_Test $test
- * @param integer $timesRepeat
+ * @param integer $timesRepeat
+ * @param mixed $filter
* @throws InvalidArgumentException
* @access public
*/
- public function __construct(PHPUnit_Framework_Test $test, $timesRepeat = 1)
+ public function __construct(PHPUnit_Framework_Test $test, $timesRepeat = 1, $filter = FALSE)
{
parent::__construct($test);
@@ -90,6 +97,8 @@ public function __construct(PHPUnit_Framework_Test $test, $timesRepeat = 1)
'Argument 2 must be a positive integer.'
);
}
+
+ $this->filter = $filter;
}
/**
@@ -120,7 +129,11 @@ public function run(PHPUnit_Framework_TestResult $result = NULL)
}
for ($i = 0; $i < $this->timesRepeat && !$result->shouldStop(); $i++) {
- $this->test->run($result);
+ if ($this->test instanceof PHPUnit_Framework_TestSuite) {
+ $this->test->run($result, $this->filter);
+ } else {
+ $this->test->run($result);
+ }
}
return $result;
@@ -175,7 +175,9 @@ public function doRun(PHPUnit_Framework_Test $suite, array $parameters = array()
$parameters['wait'] = isset($parameters['wait']) ? $parameters['wait'] : FALSE;
if (is_integer($parameters['repeat'])) {
- $suite = new PHPUnit_Extensions_RepeatedTest($suite, $parameters['repeat']);
+ $suite = new PHPUnit_Extensions_RepeatedTest(
+ $suite, $arguments['repeat'], $arguments['filter']
+ );
}
if (isset($parameters['reportDirectory'])) {

0 comments on commit 3b9531d

Please sign in to comment.