Skip to content

Commit

Permalink
moved phpt handling code to the rest of the test file handling code
Browse files Browse the repository at this point in the history
  • Loading branch information
realFlowControl authored and sebastianbergmann committed Sep 7, 2019
1 parent 111cc91 commit ed35f0d
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/TextUI/Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -804,6 +804,14 @@ protected function handleArguments(array $argv): void
$this->arguments['testFile'] = \realpath($this->arguments['test']);
$this->arguments['test'] = \substr($this->arguments['test'], 0, \strrpos($this->arguments['test'], '.'));
}

if (isset($this->arguments['test']) &&
\is_string($this->arguments['test']) &&
\substr($this->arguments['test'], -5, 5) === '.phpt') {
$test = new PhptTestCase($this->arguments['test']);
$this->arguments['test'] = new TestSuite;
$this->arguments['test']->addTest($test);
}
}

if (!isset($this->arguments['testSuffixes'])) {
Expand Down Expand Up @@ -921,13 +929,6 @@ protected function handleArguments(array $argv): void
$this->arguments['printer'] = $this->handlePrinter($this->arguments['printer']);
}

if (isset($this->arguments['test']) && \is_string($this->arguments['test']) && \substr($this->arguments['test'], -5, 5) === '.phpt') {
$test = new PhptTestCase($this->arguments['test']);

$this->arguments['test'] = new TestSuite;
$this->arguments['test']->addTest($test);
}

if (!isset($this->arguments['test'])) {
$this->showHelp();
exit(TestRunner::EXCEPTION_EXIT);
Expand Down

0 comments on commit ed35f0d

Please sign in to comment.