Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Nov 8, 2018
1 parent 9bba2c9 commit bc9f7ac
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/Framework/TestCase.php
Expand Up @@ -686,11 +686,9 @@ public function run(TestResult $result = null): TestResult
return $result;
}

$runEntireClass = $this->runClassInSeparateProcess && !$this->runTestInSeparateProcess;
if ($this->runInSeparateProcess()) {
$runEntireClass = $this->runClassInSeparateProcess && !$this->runTestInSeparateProcess;

if (($this->runTestInSeparateProcess === true || $this->runClassInSeparateProcess === true) &&
$this->inIsolation !== true &&
!$this instanceof PhptTestCase) {
$class = new ReflectionClass($this);

if ($runEntireClass) {
Expand Down Expand Up @@ -2114,4 +2112,10 @@ private function checkExceptionExpectations(Throwable $throwable): bool

return $result;
}

private function runInSeparateProcess(): bool
{
return ($this->runTestInSeparateProcess === true || $this->runClassInSeparateProcess === true) &&
$this->inIsolation !== true && !$this instanceof PhptTestCase;
}
}

0 comments on commit bc9f7ac

Please sign in to comment.