PHP Class CI_Unit_test, TastyIgniter

Afficher le fichier Open project: tastyigniter/tastyigniter Class Usage Examples

Méthodes publiques

Свойство Type Description
$active boolean Active flag
$results array Test results
$strict boolean Whether to use === or == when comparing

Protected Properties

Свойство Type Description
$_template string Template
$_template_rows string Template rows
$_test_items_visible array List of visible test items

Méthodes publiques

Méthode Description
__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

Méthodes protégées

Méthode Description
_backtrace ( ) : array Generate a backtrace
_default_template ( ) : string Get Default Template
_parse_template ( ) : void Parse Template

Method Details

__construct() public méthode

Constructor
public __construct ( ) : void
Résultat void

_backtrace() protected méthode

This lets us show file names and line numbers
protected _backtrace ( ) : array
Résultat array

_default_template() protected méthode

Get Default Template
protected _default_template ( ) : string
Résultat string

_parse_template() protected méthode

Harvests the data within the template {pseudo-variables}
protected _parse_template ( ) : void
Résultat void

active() public méthode

Enables/disables unit testing
public active ( $state = TRUE ) : void
Résultat void

report() public méthode

Displays a table with the test data
public report ( array $result = [] ) : string
$result array
Résultat string

result() public méthode

Returns the raw result data
public result ( array $results = [] ) : array
$results array
Résultat array

run() public méthode

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
Résultat string

set_template() public méthode

This lets us set the template to be used to display results
public set_template ( $template ) : void
Résultat void

set_test_items() public méthode

Runs the supplied tests
public set_test_items ( array $items ) : void
$items array
Résultat void

use_strict() public méthode

Causes the evaluation to use === rather than ==
public use_strict ( boolean $state = TRUE ) : void
$state boolean
Résultat void

Property Details

$_template protected_oe property

Template
protected string $_template
Résultat string

$_template_rows protected_oe property

Template rows
protected string $_template_rows
Résultat string

$_test_items_visible protected_oe property

List of visible test items
protected array $_test_items_visible
Résultat array

$active public_oe property

Active flag
public bool $active
Résultat boolean

$results public_oe property

Test results
public array $results
Résultat array

$strict public_oe property

Whether to use === or == when comparing
public bool $strict
Résultat boolean