From ed35f0d4d159840f0c1323e74130b3df3f86a39e Mon Sep 17 00:00:00 2001 From: Florian Engelhardt Date: Fri, 6 Sep 2019 13:25:04 +0200 Subject: [PATCH] moved phpt handling code to the rest of the test file handling code --- src/TextUI/Command.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/TextUI/Command.php b/src/TextUI/Command.php index 4b7a788348a..8f944a98327 100644 --- a/src/TextUI/Command.php +++ b/src/TextUI/Command.php @@ -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'])) { @@ -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);