Skip to content

Commit

Permalink
Update MVP #3519
Browse files Browse the repository at this point in the history
  • Loading branch information
epdenouden authored and sebastianbergmann committed Jun 15, 2020
1 parent 88a145f commit 9b806a0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
11 changes: 8 additions & 3 deletions src/Framework/TestCase.php
Expand Up @@ -1962,11 +1962,16 @@ private function handleDependencies(): bool
$passedKeys = \array_flip(\array_unique($passedKeys));

foreach ($this->dependencies as $dependency) {
if (empty($dependency)) {
$this->markSkippedForNotSpecifyingDependency();
return false;
}

if (\substr($dependency, -7) === '::class') {
$dependencyClassName = \substr($dependency, 0, -7);

if (\array_search($dependencyClassName, $this->result->passedClasses()) === false) {
$this->markSkippedForMissingDependecy($dependency);
$this->markSkippedForMissingDependency($dependency);

return false;
}
Expand Down Expand Up @@ -2001,7 +2006,7 @@ private function handleDependencies(): bool
if (!\is_callable($dependency, false, $callableName) || $dependency !== $callableName) {
$this->markWarningForUncallableDependency($dependency);
} else {
$this->markSkippedForMissingDependecy($dependency);
$this->markSkippedForMissingDependency($dependency);
}

return false;
Expand Down Expand Up @@ -2077,7 +2082,7 @@ private function markSkippedForMissingDependency(string $dependency): void
$this->result->endTest($this, 0);
}

private function warnAboutDependencyThatDoesNotExist(string $dependency): void
private function markWarningForUncallableDependency(string $dependency): void
{
$this->status = BaseTestRunner::STATUS_WARNING;

Expand Down
1 change: 0 additions & 1 deletion tests/unit/Framework/TestCaseTest.php
Expand Up @@ -12,7 +12,6 @@
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\MockObject\Stub;
use PHPUnit\Runner\BaseTestRunner;
use PHPUnit\Util\Test as TestUtil;

class TestCaseTest extends TestCase
{
Expand Down

0 comments on commit 9b806a0

Please sign in to comment.