b374k
m1n1 1.01
Apache/2.4.41 (Ubuntu)
Linux vmi616275.contaboserver.net 5.4.0-84-generic #94-Ubuntu SMP Thu Aug 26 20:27:37 UTC 2021 x86_64
uid=33(www-data) gid=33(www-data) groups=33(www-data)
server ip : 62.171.164.128 | your ip : 127.0.0.1
safemode OFF
 >  / home / a / home / dev2.destoffenstraat.com / vendor / codeception / codeception / ext /
Filename/home/a/home/dev2.destoffenstraat.com/vendor/codeception/codeception/ext/SimpleReporter.php
Size1.64 kb
Permissionrw-r--r--
Ownerroot : root
Create time21-Aug-2025 12:26
Last modified13-Mar-2022 18:07
Last accessed11-Aug-2025 04:27
Actionsedit | rename | delete | download (gzip)
Viewtext | code | image
<?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)');
}
}