options['silent'] = false; // turn on printing for this extension
$this->_reconfigure(['settings' => ['silent' => true]]); // turn off printing for everything else
$this->standardReporter = new Console($this->options);
$this->width = $this->standardReporter->detectWidth();
}
// we are listening for events
public static $events = [
Events::SUITE_BEFORE => 'beforeSuite',
Events::TEST_SUCCESS => 'success',
Events::TEST_FAIL => 'fail',
Events::TEST_ERROR => 'error',
Events::TEST_SKIPPED => 'skipped',
Events::TEST_FAIL_PRINT => 'printFailed'
];
public function beforeSuite()
{
$this->writeln("");
}
public function success()
{
$this->printChar('.');
}
public function fail(FailEvent $e)
{
$this->printChar("F");
}
public function error(FailEvent $e)
{
$this->printChar('E');
}
public function skipped()
{
$this->printChar('S');
}
protected function printChar($char)
{
if ($this->currentPos >= $this->width) {
$this->writeln('');
$this->currentPos = 0;
}
$this->write($char);
$this->currentPos++;
}
public function printFailed(FailEvent $event)
{
$this->standardReporter->printFail($event);
}
}