diff --git a/src/commands/Command.php b/src/commands/Command.php index 1590fc9..56f0d46 100644 --- a/src/commands/Command.php +++ b/src/commands/Command.php @@ -44,9 +44,10 @@ use Throwable; Examples : composer seacms-test phpunit -- -h : display phpunit help (do not forget --) composer seacms-test phpunit -- --pversion : display phpunit version - composer seacms-test help : show this help - composer seacms-test : show this help - composer seacms-test test : run tests + composer seacms-test help : show this help + composer seacms-test : show this help + composer seacms-test test : run tests + composer seacms-test test -- --filter AppTest::testInit : run tests with phpunit parameters STR) ->addArgument('type', InputArgument::OPTIONAL, 'phpunit|test') @@ -79,12 +80,12 @@ use Throwable; ] as $path){ if (is_dir($path)){ $empty = false; - $args = [ + $newargs = array_merge([ '--bootstrap', 'vendor/autoload.php', $path - ]; - $code = $this->runPhpUnitIfAvailable($args,$output); + ],$args); + $code = $this->runPhpUnitIfAvailable($newargs,$output); if ($code != Command::SUCCESS){ return $code; } @@ -95,7 +96,7 @@ use Throwable; } return Command::SUCCESS; case 'phpunit': - return $this->runPhpUnitIfAvailable($input->getArgument('args'),$output); + return $this->runPhpUnitIfAvailable($args,$output); default: // default display help