/** * Runs tests based on the given TestSuite object. * * @param \Stagehand\TestRunner\TestSuite\SimpleTestTestSuite $suite */ public function run($suite) { $textReporter = new TextReporter(); $textReporter->setRunner($this); $textReporter->setTerminal($this->terminal); $reporter = new \MultipleReporter(); $reporter->attachReporter($this->decorateReporter($textReporter)); if ($this->hasJUnitXMLFile()) { $reporter->attachReporter($this->decorateReporter($this->junitXMLReporterFactory->create($this->createJUnitXMLWriter(), $suite))); } $suite->run($reporter); $this->notification = $textReporter->getNotification(); }
public function paintFooter($test_name) { ob_start(); parent::paintFooter($test_name); $output = ob_get_contents(); ob_end_clean(); if ($this->terminal->shouldColor()) { if ($this->getFailCount() + $this->getExceptionCount() == 0) { echo Coloring::green($output); } else { echo Coloring::red($output); } } else { echo $output; } if ($this->runner->shouldNotify()) { if ($this->getFailCount() + $this->getExceptionCount() == 0) { $notificationResult = Notification::RESULT_PASSED; } else { $notificationResult = Notification::RESULT_FAILED; } $this->notification = new Notification($notificationResult, $output); } }