Server IP : 185.86.78.101 / Your IP : 216.73.216.124 Web Server : Apache System : Linux 675867-vds-valikoshka1996.gmhost.pp.ua 5.4.0-150-generic #167-Ubuntu SMP Mon May 15 17:35:05 UTC 2023 x86_64 User : www ( 1000) PHP Version : 7.4.33 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /www/wwwroot/mifepriston.org/vendor/codeception/codeception/ext/ |
Upload File : |
<?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: https://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)'); } }