// Restore conf file to make sure each test runs with a clean one file_put_contents($testConfFile, $testConf); $returncode = -1; $output_lines = ''; $exec = "run.php --type={$layer} --level=file --layer={$subLayer} --folder={$dirName}" . " --file={$fileName} --format=text --host=test 2>&1"; exec("{$php} {$exec}", $output_lines, $returncode); $message = "{$fileName}\n" . join($output_lines, "\n"); switch ($returncode) { case 0: $oReporter->paintPass($message); break; default: $message = "Unexpected return code {$returncode}\n" . $message; case 1: $message = "Directory: " . dirname(__FILE__) . "\nFailed command: {$php} {$exec}\n" . $message; $oReporter->paintFail($message); break; } $oReporter->paintMethodEnd($fileName); $oReporter->paintCaseEnd("File {$fileName}"); } $oReporter->paintGroupEnd("Directory {$dirName}"); } $oReporter->paintGroupEnd("Sublayer {$subLayer}"); } $oReporter->paintGroupEnd("Layer {$layer}"); } $oReporter->paintGroupEnd("Tests"); if ($oReporter->getStatus() == false) { exit(1); }
// Restore conf file to make sure each test runs with a clean one file_put_contents($testConfFile, $testConf); $returncode = -1; $output_lines = ''; $exec = "run.php --type={$layer} --level=file --layer={$subLayer} --folder={$dirName}" . " --file={$fileName} --format=text --host=test 2>&1"; exec("{$php} {$exec}", $output_lines, $returncode); $message = "{$fileName}\n" . join($output_lines, "\n"); switch ($returncode) { case 0: $oReporter->paintPass($message); break; default: $message = "Unexpected return code {$returncode}\n" . $message; case 1: $message = "Directory: " . dirname(__FILE__) . "\nFailed command: {$php} {$exec}\n" . $message; $oReporter->paintFail($message); break; } $oReporter->paintMethodEnd($testDisplayName); $oReporter->paintCaseEnd("File {$fileName}"); } $oReporter->paintGroupEnd("Directory {$dirName}"); } $oReporter->paintGroupEnd("Sublayer {$subLayer}"); } $oReporter->paintGroupEnd("Layer {$layer}"); } $oReporter->paintGroupEnd("Tests"); if ($oReporter->getStatus() == false) { exit(1); }