PHP Class Phrozn\Outputter\TestOutputter

Author: Victor Farazdagi
Inheritance: implements Phrozn\Outputter
Show file Open project: farazdagi/phrozn Class Usage Examples

Public Methods

Method Description
__construct ( $testCase )
assertInLogs ( string $expected, $errorMsg = "Expected to find '%s' in logs: %s" ) : void Asserts that the log buffer contains specified message
assertNotInLogs ( $message, $errorMsg = "Unexpected string '%s' found in logs: %s" ) : void Asserts that the log buffer does NOT contain specified message
getLines ( ) : array Get all outputted lines
resetLogs ( ) : void Cleanup previous logs
stderr ( string $msg, string $status = self::STATUS_FAIL ) : Phrozn\Outputter Writes the message $msg to STDERR.
stdout ( $msg, string $status = self::STATUS_OK ) : Phrozn\Outputter Add line to output

Method Details

__construct() public method

public __construct ( $testCase )

assertInLogs() public method

Asserts that the log buffer contains specified message
public assertInLogs ( string $expected, $errorMsg = "Expected to find '%s' in logs: %s" ) : void
$expected string Message subsctring
return void

assertNotInLogs() public method

Asserts that the log buffer does NOT contain specified message
public assertNotInLogs ( $message, $errorMsg = "Unexpected string '%s' found in logs: %s" ) : void
return void

getLines() public method

Get all outputted lines
public getLines ( ) : array
return array

resetLogs() public method

Cleanup previous logs
public resetLogs ( ) : void
return void

stderr() public method

Writes the message $msg to STDERR.
public stderr ( string $msg, string $status = self::STATUS_FAIL ) : Phrozn\Outputter
$msg string The message to output
$status string Output status
return Phrozn\Outputter

stdout() public method

Add line to output
public stdout ( $msg, string $status = self::STATUS_OK ) : Phrozn\Outputter
$status string Output status
return Phrozn\Outputter