PHP Class Peridot\Reporter\AbstractBaseReporter

Inheritance: implements Peridot\Reporter\ReporterInterface, use trait Peridot\Core\HasEventEmitterTrait
Afficher le fichier Open project: peridot-php/peridot Class Usage Examples

Protected Properties

Свойство Type Description
$colors array Maps color names to left and right color sequences.
$configuration Peridot\Configuration
$errors array
$output Symfony\Component\Console\Output\OutputInterface
$passing integer
$pending integer
$symbols array Maps symbol names to symbols
$time double | integer

Méthodes publiques

Méthode Description
__construct ( Configuration $configuration, Symfony\Component\Console\Output\OutputInterface $output, Evenement\EventEmitterInterface $eventEmitter )
color ( $key, $text ) : string Given a color name, colorize the provided text in that color
footer ( ) Output result footer
getConfiguration ( ) : Configuration Return the Configuration associated with the Reporter
getOutput ( ) : Symfony\Component\Console\Output\OutputInterface Return the OutputInterface associated with the Reporter
getTime ( ) : float Get the run time to report.
init ( ) : void Initialize reporter. Setup and listen for events
setTime ( float $time ) Set the run time to report.
symbol ( $name ) : string Fetch a symbol by name

Méthodes protégées

Méthode Description
hasColorSupport ( ) : boolean Determine if colorized output is supported by the reporters output.
isOnWindows ( ) : boolean Return true if reporter is being used on windows
outputError ( integer $errorNumber, Peridot\Core\TestInterface $test, $exception ) Output a test failure.
registerSymbols ( ) Register reporter symbols, additionally checking OS compatibility.

Private Methods

Méthode Description
hasAnsiSupport ( ) : boolean Determine if the terminal has ansicon support
hasTty ( ) : boolean Determine if reporter is reporting to a tty terminal.
isTtyTerminal ( Symfony\Component\Console\Output\StreamOutput $output ) : boolean See if stream output is a tty terminal.
registerEvents ( ) Register events tracking state relevant to all reporters.

Method Details

__construct() public méthode

public __construct ( Configuration $configuration, Symfony\Component\Console\Output\OutputInterface $output, Evenement\EventEmitterInterface $eventEmitter )
$configuration Peridot\Configuration
$output Symfony\Component\Console\Output\OutputInterface
$eventEmitter Evenement\EventEmitterInterface

color() public méthode

Given a color name, colorize the provided text in that color
public color ( $key, $text ) : string
$key
$text
Résultat string

getConfiguration() public méthode

Return the Configuration associated with the Reporter
public getConfiguration ( ) : Configuration
Résultat Peridot\Configuration

getOutput() public méthode

Return the OutputInterface associated with the Reporter
public getOutput ( ) : Symfony\Component\Console\Output\OutputInterface
Résultat Symfony\Component\Console\Output\OutputInterface

getTime() public méthode

Get the run time to report.
public getTime ( ) : float
Résultat float

hasColorSupport() protected méthode

Taken from Symfony's console output with some slight modifications to use the reporter's output stream
protected hasColorSupport ( ) : boolean
Résultat boolean

init() abstract public méthode

Initialize reporter. Setup and listen for events
abstract public init ( ) : void
Résultat void

isOnWindows() protected méthode

Return true if reporter is being used on windows
protected isOnWindows ( ) : boolean
Résultat boolean

outputError() protected méthode

Output a test failure.
protected outputError ( integer $errorNumber, Peridot\Core\TestInterface $test, $exception )
$errorNumber integer
$test Peridot\Core\TestInterface
$exception - an exception like interface with ->getMessage(), ->getTraceAsString()

registerSymbols() protected méthode

Register reporter symbols, additionally checking OS compatibility.
protected registerSymbols ( )

setTime() public méthode

Set the run time to report.
public setTime ( float $time )
$time float

symbol() public méthode

Fetch a symbol by name
public symbol ( $name ) : string
$name
Résultat string

Property Details

$colors protected_oe property

Maps color names to left and right color sequences.
protected array $colors
Résultat array

$configuration protected_oe property

protected Configuration,Peridot $configuration
Résultat Peridot\Configuration

$errors protected_oe property

protected array $errors
Résultat array

$output protected_oe property

protected OutputInterface,Symfony\Component\Console\Output $output
Résultat Symfony\Component\Console\Output\OutputInterface

$passing protected_oe property

protected int $passing
Résultat integer

$pending protected_oe property

protected int $pending
Résultat integer

$symbols protected_oe property

Maps symbol names to symbols
protected array $symbols
Résultat array

$time protected_oe property

protected double|int $time
Résultat double | integer