PHP Класс unittest\Output

Наследование: use trait XPSPL\Singleton
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$colors Color codes

Защищенные свойства (Protected)

Свойство Тип Описание
$_breakcount Line break count
$_maxdepth Max recursion depth.

Открытые методы

Метод Описание
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.

Описание методов

assertion() публичный Метод

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
Результат void

backtrace() публичный Метод

The output generator is at fault for providing it simplified.
public backtrace ( array $backtrace, $type = self::ERROR ) : void
$backtrace array debug_print_backtrace()
Результат void

get_assertion_call_line() публичный Метод

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
Результат array

send() публичный статический Метод

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.
Результат void

send_linebreak() публичный Метод

Sends a line break to the output with a border.
public send_linebreak ( $type = null ) : void
Результат void

unknown_assertion() публичный Метод

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
Результат void

use_short_vars() публичный Метод

Returns if short vars are enabled or to use.
public use_short_vars ( string $str = null ) : boolean
$str string
Результат boolean

variable() публичный Метод

Recursion is not checked for.
public variable ( mixed $v, integer &$depth ) : string
$v mixed
$depth integer Current transvering depth.
Результат string

Описание свойств

$_breakcount защищенное свойство

Line break count
protected $_breakcount

$_maxdepth защищенное свойство

Max recursion depth.
protected $_maxdepth

$colors публичное статическое свойство

Color codes
public static $colors