|
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/DotReporter.php |
Size | 2.53 kb |
Permission | rw-r--r-- |
Owner | root : root |
Create time | 21-Aug-2025 12:26 |
Last modified | 13-Mar-2022 18:07 |
Last accessed | 11-Aug-2025 04:27 |
Actions | edit | rename | delete | download (gzip) |
View | text | code | image |
<?php
namespace Codeception\Extension;
use Codeception\Event\FailEvent;
use Codeception\Events;
use Codeception\Extension;
use Codeception\Subscriber\Console;
/**
* DotReporter provides less verbose output for test execution.
* Like PHPUnit printer it prints dots "." for successful testes and "F" for failures.
*
* 
*
* ```bash
* ..........
* ..........
* ..........
* ..........
* ..........
* ..........
* ..........
* ..........
*
* Time: 2.07 seconds, Memory: 20.00MB
*
* OK (80 tests, 124 assertions)
* ```
*
*
* Enable this reporter with `--ext option`
*
* ```
* codecept run --ext DotReporter
* ```
*
* Failures and Errors are printed by a standard Codeception reporter.
* Use this extension as an example for building custom reporters.
*/
class DotReporter extends Extension
{
/**
* @var Console
*/
protected $standardReporter;
protected $errors = [];
protected $failures = [];
protected $width = 10;
protected $currentPos = 0;
public function _initialize()
{
$this->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("<error>F</error>");
}
public function error(FailEvent $e)
{
$this->printChar('<error>E</error>');
}
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);
}
}
namespace Codeception\Extension;
use Codeception\Event\FailEvent;
use Codeception\Events;
use Codeception\Extension;
use Codeception\Subscriber\Console;
/**
* DotReporter provides less verbose output for test execution.
* Like PHPUnit printer it prints dots "." for successful testes and "F" for failures.
*
* 
*
* ```bash
* ..........
* ..........
* ..........
* ..........
* ..........
* ..........
* ..........
* ..........
*
* Time: 2.07 seconds, Memory: 20.00MB
*
* OK (80 tests, 124 assertions)
* ```
*
*
* Enable this reporter with `--ext option`
*
* ```
* codecept run --ext DotReporter
* ```
*
* Failures and Errors are printed by a standard Codeception reporter.
* Use this extension as an example for building custom reporters.
*/
class DotReporter extends Extension
{
/**
* @var Console
*/
protected $standardReporter;
protected $errors = [];
protected $failures = [];
protected $width = 10;
protected $currentPos = 0;
public function _initialize()
{
$this->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("<error>F</error>");
}
public function error(FailEvent $e)
{
$this->printChar('<error>E</error>');
}
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);
}
}