PHP 클래스 kahlan\Suite

상속: extends Scope
파일 보기 프로젝트 열기: crysalead/kahlan 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$PHP

보호된 프로퍼티들

프로퍼티 타입 설명
$_autoclear array Array of fully-namespaced class name to clear on each it().
$_callbacks array The each callbacks.
$_children Suite[] | Specification[] The children array.
$_ff integer Set the number of fails allowed before aborting. 0 mean no fast fail.
$_registered array Store all hashed references.
$_stats array Suite statistics.
$_status integer The return status value (0 for success).

공개 메소드들

메소드 설명
__construct ( array $config = [] ) The Constructor.
afterAll ( Closure $closure ) : self Executed after tests.
afterEach ( Closure $closure ) : self Executed after each tests.
autoclear ( ) Autoclears plugins.
beforeAll ( Closure $closure ) : self Executed before tests.
beforeEach ( Closure $closure ) : self Executed before each tests.
callbacks ( string $type ) : array Gets callbacks.
children ( ) : array Gets children.
context ( string $message, Closure $closure, null $timeout = null, string $type = 'normal' ) : Suite Adds a context related spec.
describe ( string $message, Closure $closure, $timeout = null, $type = 'normal' ) : Suite Adds a group/class related spec.
enabled ( ) : integer Gets number of enabled specs.
failfast ( ) : boolean; Returns true if the suite reach the number of allowed failure by the fail-fast parameter.
fcontext ( string $message, Closure $closure, $timeout = null ) : Suite Adds an focused context related spec.
fdescribe ( string $message, Closure $closure, $timeout = null ) : Suite Adds an focused group/class related spec.
fit ( string | Closur\Closure $message, Closur\Closure | null $closure = null, $timeout = null ) : Specification Adds an focused spec.
hash ( mixed $reference ) : string Generates a hash from an instance or a string.
it ( string | Closur\Closure $message, Closure $closure = null, $timeout = null, string $type = 'normal' ) : Specification Adds a spec.
passed ( ) : boolean Checks if all test passed.
register ( mixed $hash ) Registers a hash. [Mainly used for optimization]
registered ( string $hash = null ) : array | boolean Gets registered hashes. [Mainly used for optimizations]
reset ( ) Clears the registered hash.
run ( array $options = [] ) : boolean Runs all specs.
runCallbacks ( string $name, $recursive = true ) Runs a callback.
status ( integer $status = null ) : boolean Gets exit status code according passed results.
stop ( ) Triggers the stop event.
total ( ) : integer Gets number of total specs.
xcontext ( string $message, Closure $closure, $timeout = null ) Comments out a context related spec.
xdescribe ( string $message, Closure $closure, $timeout = null ) Comments out a group/class related spec.
xit ( string | Closur\Closure $message, Closur\Closure | null $closure = null, $timeout = null ) Comments out a spec.

보호된 메소드들

메소드 설명
_broadcastFocus ( ) Applies focus downward to the leaf.
_errorHandler ( boolean $enable, array $options = [] ) Overrides the default error handler
_process ( array $options = [] ) Suite processing.
_stats ( ) : array Builds the suite.
_suiteEnd ( ) Suite end helper.
_suiteStart ( ) Suite start helper.
stats ( ) : array Builds the suite.

메소드 상세

__construct() 공개 메소드

The Constructor.
public __construct ( array $config = [] )
$config array The Suite config array. Options are: -`'closure'` _Closure_: the closure of the test. -`'name'` _string_ : the type of the suite.

_broadcastFocus() 보호된 메소드

Applies focus downward to the leaf.
protected _broadcastFocus ( )

_errorHandler() 보호된 메소드

Overrides the default error handler
protected _errorHandler ( boolean $enable, array $options = [] )
$enable boolean If `true` override the default error handler, if `false` restore the default handler.
$options array An options array. Available options are: - 'handler': An error handler closure.

_process() 보호된 메소드

Suite processing.
protected _process ( array $options = [] )
$options array Process options.

_stats() 보호된 메소드

Builds the suite.
protected _stats ( ) : array
리턴 array The suite stats.

_suiteEnd() 보호된 메소드

Suite end helper.
protected _suiteEnd ( )

_suiteStart() 보호된 메소드

Suite start helper.
protected _suiteStart ( )

afterAll() 공개 메소드

Executed after tests.
public afterAll ( Closure $closure ) : self
$closure Closure A closure
리턴 self

afterEach() 공개 메소드

Executed after each tests.
public afterEach ( Closure $closure ) : self
$closure Closure A closure
리턴 self

autoclear() 공개 메소드

Autoclears plugins.
public autoclear ( )

beforeAll() 공개 메소드

Executed before tests.
public beforeAll ( Closure $closure ) : self
$closure Closure A closure
리턴 self

beforeEach() 공개 메소드

Executed before each tests.
public beforeEach ( Closure $closure ) : self
$closure Closure A closure
리턴 self

callbacks() 공개 메소드

Gets callbacks.
public callbacks ( string $type ) : array
$type string The type of callbacks to get.
리턴 array The array callbacks instances.

children() 공개 메소드

Gets children.
public children ( ) : array
리턴 array The array of children instances.

context() 공개 메소드

Adds a context related spec.
public context ( string $message, Closure $closure, null $timeout = null, string $type = 'normal' ) : Suite
$message string Description message.
$closure Closure A test case closure.
$timeout null
$type string
리턴 Suite

describe() 공개 메소드

Adds a group/class related spec.
public describe ( string $message, Closure $closure, $timeout = null, $type = 'normal' ) : Suite
$message string Description message.
$closure Closure A test case closure.
리턴 Suite

enabled() 공개 메소드

Gets number of enabled specs.
public enabled ( ) : integer
리턴 integer

failfast() 공개 메소드

Returns true if the suite reach the number of allowed failure by the fail-fast parameter.
public failfast ( ) : boolean;
리턴 boolean;

fcontext() 공개 메소드

Adds an focused context related spec.
public fcontext ( string $message, Closure $closure, $timeout = null ) : Suite
$message string Description message.
$closure Closure A test case closure.
리턴 Suite

fdescribe() 공개 메소드

Adds an focused group/class related spec.
public fdescribe ( string $message, Closure $closure, $timeout = null ) : Suite
$message string Description message.
$closure Closure A test case closure.
리턴 Suite

fit() 공개 메소드

Adds an focused spec.
public fit ( string | Closur\Closure $message, Closur\Closure | null $closure = null, $timeout = null ) : Specification
$message string | Closur\Closure Description message or a test closure.
$closure Closur\Closure | null A test case closure or `null`.
리턴 Specification

hash() 공개 정적인 메소드

Generates a hash from an instance or a string.
public static hash ( mixed $reference ) : string
$reference mixed An instance or a fully namespaced class name.
리턴 string A string hash.

it() 공개 메소드

Adds a spec.
public it ( string | Closur\Closure $message, Closure $closure = null, $timeout = null, string $type = 'normal' ) : Specification
$message string | Closur\Closure Description message or a test closure.
$closure Closure A test case closure.
$type string The type.
리턴 Specification

passed() 공개 메소드

Checks if all test passed.
public passed ( ) : boolean
리턴 boolean Returns `true` if no error occurred, `false` otherwise.

register() 공개 정적인 메소드

Registers a hash. [Mainly used for optimization]
public static register ( mixed $hash )
$hash mixed A hash to register.

registered() 공개 정적인 메소드

Gets registered hashes. [Mainly used for optimizations]
public static registered ( string $hash = null ) : array | boolean
$hash string The hash to look up. If none return all registered hashes.
리턴 array | boolean

reset() 공개 정적인 메소드

Clears the registered hash.
public static reset ( )

run() 공개 메소드

Runs all specs.
public run ( array $options = [] ) : boolean
$options array Run options.
리턴 boolean The result array.

runCallbacks() 공개 메소드

Runs a callback.
public runCallbacks ( string $name, $recursive = true )
$name string The name of the callback (i.e `'beforeEach'` or `'afterEach'`).

stats() 보호된 메소드

Builds the suite.
protected stats ( ) : array
리턴 array The suite stats.

status() 공개 메소드

Gets exit status code according passed results.
public status ( integer $status = null ) : boolean
$status integer If set force a specific status to be retruned.
리턴 boolean Returns `0` if no error occurred, `-1` otherwise.

stop() 공개 메소드

Triggers the stop event.
public stop ( )

total() 공개 메소드

Gets number of total specs.
public total ( ) : integer
리턴 integer

xcontext() 공개 메소드

Comments out a context related spec.
public xcontext ( string $message, Closure $closure, $timeout = null )
$message string Description message.
$closure Closure A test case closure.

xdescribe() 공개 메소드

Comments out a group/class related spec.
public xdescribe ( string $message, Closure $closure, $timeout = null )
$message string Description message.
$closure Closure A test case closure.

xit() 공개 메소드

Comments out a spec.
public xit ( string | Closur\Closure $message, Closur\Closure | null $closure = null, $timeout = null )
$message string | Closur\Closure Description message or a test closure.
$closure Closur\Closure | null A test case closure or `null`.

프로퍼티 상세

$PHP 공개적으로 정적으로 프로퍼티

public static $PHP

$_autoclear 보호되어 있는 프로퍼티

Array of fully-namespaced class name to clear on each it().
protected array $_autoclear
리턴 array

$_callbacks 보호되어 있는 프로퍼티

The each callbacks.
protected array $_callbacks
리턴 array

$_children 보호되어 있는 프로퍼티

The children array.
protected Suite[],kahlan|Specification[],kahlan $_children
리턴 Suite[] | Specification[]

$_ff 보호되어 있는 프로퍼티

Set the number of fails allowed before aborting. 0 mean no fast fail.
또한 보기: ::failfast()
protected int $_ff
리턴 integer

$_registered 보호되어 있는 정적으로 프로퍼티

Store all hashed references.
protected static array $_registered
리턴 array

$_stats 보호되어 있는 프로퍼티

Suite statistics.
protected array $_stats
리턴 array

$_status 보호되어 있는 프로퍼티

The return status value (0 for success).
protected int $_status
리턴 integer