Skip to content

Commit

Permalink
Fixed issue: sebastianbergmann#3450
Browse files Browse the repository at this point in the history
  • Loading branch information
NikoGrano committed Dec 11, 2018
1 parent 97b3201 commit bc04605
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions src/Framework/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -1785,10 +1785,19 @@ private function handleDependencies(): bool
}
}

if (isset($passed[$dependency])) {
if ($passed[$dependency]['size'] != \PHPUnit\Util\Test::UNKNOWN &&
$dependencyName = false;
if (isset($passed[$dependency]))
{
$dependencyName = $dependency;
} else if (isset($passed[$dependency.$this->getDataSetAsString(false)]))
{
$dependencyName = $dependency.$this->getDataSetAsString(false);
}

if ($dependencyName) {
if ($passed[$dependencyName]['size'] != \PHPUnit\Util\Test::UNKNOWN &&
$this->getSize() != \PHPUnit\Util\Test::UNKNOWN &&
$passed[$dependency]['size'] > $this->getSize()) {
$passed[$dependencyName]['size'] > $this->getSize()) {
$this->result->addError(
$this,
new SkippedTestError(
Expand All @@ -1804,11 +1813,11 @@ private function handleDependencies(): bool
$deepCopy = new DeepCopy;
$deepCopy->skipUncloneable(false);

$this->dependencyInput[$dependency] = $deepCopy->copy($passed[$dependency]['result']);
$this->dependencyInput[$dependency] = $deepCopy->copy($passed[$dependencyName]['result']);
} elseif ($shallowClone) {
$this->dependencyInput[$dependency] = clone $passed[$dependency]['result'];
$this->dependencyInput[$dependency] = clone $passed[$dependencyName]['result'];
} else {
$this->dependencyInput[$dependency] = $passed[$dependency]['result'];
$this->dependencyInput[$dependency] = $passed[$dependencyName]['result'];
}
} else {
$this->dependencyInput[$dependency] = null;
Expand Down

0 comments on commit bc04605

Please sign in to comment.