%PDF- <> %âãÏÓ endobj 2 0 obj <> endobj 3 0 obj <>/ExtGState<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI] >>/Annots[ 28 0 R 29 0 R] /MediaBox[ 0 0 595.5 842.25] /Contents 4 0 R/Group<>/Tabs/S>> endobj ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<> endobj 2 0 obj<>endobj 2 0 obj<>es 3 0 R>> endobj 2 0 obj<> ox[ 0.000000 0.000000 609.600000 935.600000]/Fi endobj 3 0 obj<> endobj 7 1 obj<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI]>>/Subtype/Form>> stream
<?php
namespace Codeception\Extension;
use Codeception\Event\TestEvent;
use Codeception\Events;
use Codeception\Extension;
use Codeception\Test\Descriptor;
/**
* This extension demonstrates how you can implement console output of your own.
* Recommended to be used for development purposes only.
*/
class SimpleReporter extends Extension
{
public function _initialize()
{
$this->options['silent'] = false; // turn on printing for this extension
$this->_reconfigure(['settings' => ['silent' => true]]); // turn off printing for everything else
}
// we are listening for events
public static $events = [
Events::SUITE_BEFORE => 'beforeSuite',
Events::TEST_END => 'after',
Events::TEST_SUCCESS => 'success',
Events::TEST_FAIL => 'fail',
Events::TEST_ERROR => 'error',
];
public function beforeSuite()
{
$this->writeln("");
}
public function success()
{
$this->write('[+] ');
}
public function fail()
{
$this->write('[-] ');
}
public function error()
{
$this->write('[E] ');
}
// we are printing test status and time taken
public function after(TestEvent $e)
{
$seconds_input = $e->getTime();
// stack overflow: http://stackoverflow.com/questions/16825240/how-to-convert-microtime-to-hhmmssuu
$seconds = (int)($milliseconds = (int)($seconds_input * 1000)) / 1000;
$time = ($seconds % 60) . (($milliseconds === 0) ? '' : '.' . $milliseconds);
$this->write(Descriptor::getTestSignature($e->getTest()));
$this->writeln(' (' . $time . 's)');
}
}