|
|
@ -13,6 +13,8 @@ use Symfony\Component\Console\Input\ArrayInput; |
|
|
|
use Symfony\Component\Console\Input\InputArgument; |
|
|
|
use Symfony\Component\Console\Input\InputArgument; |
|
|
|
use Symfony\Component\Console\Input\InputInterface; |
|
|
|
use Symfony\Component\Console\Input\InputInterface; |
|
|
|
use Symfony\Component\Console\Input\InputOption; |
|
|
|
use Symfony\Component\Console\Input\InputOption; |
|
|
|
|
|
|
|
use Symfony\Component\Console\Output\BufferedOutput; |
|
|
|
|
|
|
|
use Symfony\Component\Console\Output\ConsoleOutputInterface; |
|
|
|
use Symfony\Component\Console\Output\OutputInterface; |
|
|
|
use Symfony\Component\Console\Output\OutputInterface; |
|
|
|
use Throwable; |
|
|
|
use Throwable; |
|
|
|
|
|
|
|
|
|
|
@ -116,9 +118,18 @@ use Throwable; |
|
|
|
$app->setCatchExceptions(false); // force not catching exceptions |
|
|
|
$app->setCatchExceptions(false); // force not catching exceptions |
|
|
|
$app->setAutoExit(false); // force not exiting |
|
|
|
$app->setAutoExit(false); // force not exiting |
|
|
|
try { |
|
|
|
try { |
|
|
|
|
|
|
|
// if ($output instanceof ConsoleOutputInterface){ |
|
|
|
|
|
|
|
// $errBuffer = new BufferedOutput(); |
|
|
|
|
|
|
|
// $output->setErrorOutput($errBuffer); |
|
|
|
|
|
|
|
// } |
|
|
|
$code = $app->run(new ArrayInput($def),$output); |
|
|
|
$code = $app->run(new ArrayInput($def),$output); |
|
|
|
if ($code != 0 && $code != 2){ |
|
|
|
if ($code != 0){ |
|
|
|
$output->writeln("<info>Commands {$def['command']} return code $code</info>"); |
|
|
|
$output->writeln("<info>Commands {$def['command']} return code $code</info>"); |
|
|
|
|
|
|
|
// if ($errBuffer){ |
|
|
|
|
|
|
|
// $errorOutput = $errBuffer->fetch(); |
|
|
|
|
|
|
|
// $output->writeln("<warning>Error</warning>"); |
|
|
|
|
|
|
|
// $output->writeln($errorOutput); |
|
|
|
|
|
|
|
// } |
|
|
|
return Command::FAILURE; |
|
|
|
return Command::FAILURE; |
|
|
|
} |
|
|
|
} |
|
|
|
} catch (Throwable $th){ |
|
|
|
} catch (Throwable $th){ |
|
|
@ -149,8 +160,13 @@ use Throwable; |
|
|
|
if ($this->canRunPhpunit()){ |
|
|
|
if ($this->canRunPhpunit()){ |
|
|
|
$def = [ |
|
|
|
$def = [ |
|
|
|
'command' => 'exec', |
|
|
|
'command' => 'exec', |
|
|
|
'binary' => 'phpunit' |
|
|
|
'binary' => 'phpunit', |
|
|
|
|
|
|
|
// '-v' => '-v', // only for debug command exec |
|
|
|
]; |
|
|
|
]; |
|
|
|
|
|
|
|
$args = array_merge([ |
|
|
|
|
|
|
|
// '-v' => '--verbose', // verbse phpunit |
|
|
|
|
|
|
|
// '--debug' => '--debug', // debug phpunit |
|
|
|
|
|
|
|
],$args); |
|
|
|
if (!empty($args)){ |
|
|
|
if (!empty($args)){ |
|
|
|
$def['args'] = array_map(function($v){ |
|
|
|
$def['args'] = array_map(function($v){ |
|
|
|
return ($v == '--pversion') ? '--version' : $v; // hack to prevent bad caught |
|
|
|
return ($v == '--pversion') ? '--version' : $v; // hack to prevent bad caught |
|
|
|