PHP Class unittest\Output

Inheritance: use trait XPSPL\Singleton
Afficher le fichier Open project: prggmr/xpspl Class Usage Examples

Méthodes publiques

Свойство Type Description
$colors Color codes

Protected Properties

Свойство Type Description
$_breakcount Line break count
$_maxdepth Max recursion depth.

Méthodes publiques

Méthode Description
assertion ( $test, string $assertion, array | null $args, null | boolean $result ) : void Outputs an assertion result.
backtrace ( array $backtrace, $type = self::ERROR ) : void Outputs a readable backtrace, by default it just dumps it from a for.
get_assertion_call_line ( ) : array Returns the location an assertion was called.
send ( string $string, string $type = null, boolean $newline = true ) : void Sends a string to output.
send_linebreak ( $type = null ) : void Sends a line break to the output with a border.
unknown_assertion ( $signal, string $func, array $args, object $assertion ) : void Generates an error indicating an unknown assertion has been called.
use_short_vars ( string $str = null ) : boolean Returns if short vars are enabled or to use.
variable ( mixed $v, integer &$depth ) : string Generates PHP vars like printr, var_dump the output is limited by using shortvars and the maximum output length.

Method Details

assertion() public méthode

Outputs an assertion result.
public assertion ( $test, string $assertion, array | null $args, null | boolean $result ) : void
$assertion string Name of the assertion
$args array | null Array of arguments used during test
$result null | boolean True-pass,False-fail,null-skipped
Résultat void

backtrace() public méthode

The output generator is at fault for providing it simplified.
public backtrace ( array $backtrace, $type = self::ERROR ) : void
$backtrace array debug_print_backtrace()
Résultat void

get_assertion_call_line() public méthode

Currently this just returns the node at index 3 a more advanced method for determaining the assertion call will need to be developed to account for changes in the flow.
public get_assertion_call_line ( ) : array
Résultat array

send() public static méthode

Sends a string to output.
public static send ( string $string, string $type = null, boolean $newline = true ) : void
$string string Message to output
$type string Type of message for color generation if used.
$newline boolean Output line after string.
Résultat void

send_linebreak() public méthode

Sends a line break to the output with a border.
public send_linebreak ( $type = null ) : void
Résultat void

unknown_assertion() public méthode

Generates an error indicating an unknown assertion has been called.
public unknown_assertion ( $signal, string $func, array $args, object $assertion ) : void
$func string Assertion function called
$args array Array of arguments passed to the assertion
$assertion object The assertion object used
Résultat void

use_short_vars() public méthode

Returns if short vars are enabled or to use.
public use_short_vars ( string $str = null ) : boolean
$str string
Résultat boolean

variable() public méthode

Recursion is not checked for.
public variable ( mixed $v, integer &$depth ) : string
$v mixed
$depth integer Current transvering depth.
Résultat string

Property Details

$_breakcount protected_oe property

Line break count
protected $_breakcount

$_maxdepth protected_oe property

Max recursion depth.
protected $_maxdepth

$colors public_oe static_oe property

Color codes
public static $colors