PHP Класс CI_Unit_test, TastyIgniter

Показать файл Открыть проект Примеры использования класса

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

Свойство Тип Описание
$active boolean Active flag
$results array Test results
$strict boolean Whether to use === or == when comparing

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

Свойство Тип Описание
$_template string Template
$_template_rows string Template rows
$_test_items_visible array List of visible test items

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

Метод Описание
__construct ( ) : void Constructor
active ( $state = TRUE ) : void Make Unit testing active
report ( array $result = [] ) : string Generate a report
result ( array $results = [] ) : array Result Array
run ( mixed $test, mixed $expected = TRUE, string $test_name = 'undefined', string $notes = '' ) : string Run the tests
set_template ( $template ) : void Set the template
set_test_items ( array $items ) : void Run the tests
use_strict ( boolean $state = TRUE ) : void Use strict comparison

Защищенные методы

Метод Описание
_backtrace ( ) : array Generate a backtrace
_default_template ( ) : string Get Default Template
_parse_template ( ) : void Parse Template

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

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

Constructor
public __construct ( ) : void
Результат void

_backtrace() защищенный Метод

This lets us show file names and line numbers
protected _backtrace ( ) : array
Результат array

_default_template() защищенный Метод

Get Default Template
protected _default_template ( ) : string
Результат string

_parse_template() защищенный Метод

Harvests the data within the template {pseudo-variables}
protected _parse_template ( ) : void
Результат void

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

Enables/disables unit testing
public active ( $state = TRUE ) : void
Результат void

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

Displays a table with the test data
public report ( array $result = [] ) : string
$result array
Результат string

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

Returns the raw result data
public result ( array $results = [] ) : array
$results array
Результат array

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

Runs the supplied tests
public run ( mixed $test, mixed $expected = TRUE, string $test_name = 'undefined', string $notes = '' ) : string
$test mixed
$expected mixed
$test_name string
$notes string
Результат string

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

This lets us set the template to be used to display results
public set_template ( $template ) : void
Результат void

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

Runs the supplied tests
public set_test_items ( array $items ) : void
$items array
Результат void

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

Causes the evaluation to use === rather than ==
public use_strict ( boolean $state = TRUE ) : void
$state boolean
Результат void

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

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

Template
protected string $_template
Результат string

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

Template rows
protected string $_template_rows
Результат string

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

List of visible test items
protected array $_test_items_visible
Результат array

$active публичное свойство

Active flag
public bool $active
Результат boolean

$results публичное свойство

Test results
public array $results
Результат array

$strict публичное свойство

Whether to use === or == when comparing
public bool $strict
Результат boolean