PHP Class Peridot\Reporter\AbstractBaseReporter

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

Protected Properties

Property 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

Public Methods

Method 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

Protected Methods

Method 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

Method 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 method

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 method

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

getConfiguration() public method

Return the Configuration associated with the Reporter
public getConfiguration ( ) : Configuration
return Peridot\Configuration

getOutput() public method

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

getTime() public method

Get the run time to report.
public getTime ( ) : float
return float

hasColorSupport() protected method

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

init() abstract public method

Initialize reporter. Setup and listen for events
abstract public init ( ) : void
return void

isOnWindows() protected method

Return true if reporter is being used on windows
protected isOnWindows ( ) : boolean
return boolean

outputError() protected method

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 method

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

setTime() public method

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

symbol() public method

Fetch a symbol by name
public symbol ( $name ) : string
$name
return string

Property Details

$colors protected_oe property

Maps color names to left and right color sequences.
protected array $colors
return array

$configuration protected_oe property

protected Configuration,Peridot $configuration
return Peridot\Configuration

$errors protected_oe property

protected array $errors
return array

$output protected_oe property

protected OutputInterface,Symfony\Component\Console\Output $output
return Symfony\Component\Console\Output\OutputInterface

$passing protected_oe property

protected int $passing
return integer

$pending protected_oe property

protected int $pending
return integer

$symbols protected_oe property

Maps symbol names to symbols
protected array $symbols
return array

$time protected_oe property

protected double|int $time
return double | integer