Permalink
Browse files

Fix TRAC-1021.

  • Loading branch information...
1 parent abe9e50 commit bae0bdfb590211ed1649d300b4cedc2cc9f1b4d0 @sebastianbergmann committed Apr 1, 2010
Showing with 18 additions and 2 deletions.
  1. +17 −2 PHPUnit/Framework/TestCase.php
  2. +1 −0 README.markdown
@@ -518,7 +518,18 @@ public function run(PHPUnit_Framework_TestResult $result = NULL)
if (!empty($this->dependencies) && !$this->inIsolation) {
$className = get_class($this);
$passed = $this->result->passed();
- $passedKeys = array_flip(array_keys($passed));
+ $passedKeys = array_keys($passed);
+ $numKeys = count($passedKeys);
+
+ for ($i = 0; $i < $numKeys; $i++) {
+ $pos = strpos($passedKeys[$i], ' with data set');
+
+ if ($pos !== FALSE) {
+ $passedKeys[$i] = substr($passedKeys[$i], 0, $pos);
+ }
+ }
+
+ $passedKeys = array_flip(array_unique($passedKeys));
foreach ($this->dependencies as $dependency) {
if (strpos($dependency, '::') === FALSE) {
@@ -538,7 +549,11 @@ public function run(PHPUnit_Framework_TestResult $result = NULL)
return;
} else {
- $this->dependencyInput[] = $passed[$dependency];
+ if (isset($passed[$dependency])) {
+ $this->dependencyInput[] = $passed[$dependency];
+ } else {
+ $this->dependencyInput[] = NULL;
+ }
}
}
}
View
@@ -9,6 +9,7 @@ PHPUnit 3.4.12
* Implemented TRAC-1027: Declare a decent return-type in `PHPUnit_Framework_TestCase::getMock()`.
* Fixed TRAC-1013: `Undefined index: _ENV` running supplied tests.
* Fixed TRAC-1016: Usage of `{}` to access string offsets is deprecated.
+* Fixed TRAC-1021: Depending on a test that uses a data provider does not work.
PHPUnit 3.4.11
--------------

0 comments on commit bae0bdf

Please sign in to comment.