PHP 클래스 kahlan\Scope

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

공개 프로퍼티들

프로퍼티 타입 설명
$blacklist array List of reserved keywords which can't be used as scope variable.

보호된 프로퍼티들

프로퍼티 타입 설명
$_backtrace object The scope backtrace.
$_backtraceFocus string A regexp pattern used to removes useless traces to focus on the one related to a spec file.
$_closure Closur\Closure The spec closure.
$_data array The scope's data.
$_failures integer Count the number of failure or exception.
$_given array The lazy loaded scope's data.
$_instances Scope[] Instances stack.
$_locked Boolean lock which avoid process() to be called in tests
$_log object The report log of executed spec.
$_message string The spec message.
$_parent Scope The parent instance.
$_passed boolean Stores the success value.
$_reporters object The reporters container.
$_root object The root instance.
$_runned boolean Indicates whether the scope has been runned or not.
$_summary object The execution summary instance.
$_timeout integer The timeout value.
$_type object The scope type.

공개 메소드들

메소드 설명
__call ( string $name, array $args ) : mixed Allow closures assigned to the scope property to be inkovable.
__construct ( array $config = [] ) The Constructor.
__get ( string $key ) : mixed Getter.
__set ( string $key, mixed $value ) : mixed Setter.
backtrace ( ) : array Gets the backtrace array.
backtraceFocus ( string $pattern = null ) : string Gets/sets the regexp pattern used to removes useless traces to focus on the one related to a spec file.
current ( ) : Scope Get the active scope instance.
excluded ( ) : boolean Check for excluded mode.
focused ( ) : boolean Check for focused mode.
given ( string $name, Closur\Closure $closure ) : object Sets a lazy loaded data.
log ( $type = null, $data = [] ) Dispatches a report up to the root scope.
message ( ) : array Gets the spec's message.
messages ( ) : array Gets all messages upon the root.
parent ( ) : Scope Gets the parent instance.
report ( string $type, mixed $data, $byPassFocuses = false ) Send some data to reporters.
reporters ( ) : object Gets the reporters container.
skipIf ( boolean $condition ) Skips specs(s) if the condition is true.
summary ( ) : array Gets specs excecution results.
timeout ( $timeout = null ) : integer Gets/sets the timeout.
type ( $type = null ) : mixed Set/get the scope type.

보호된 메소드들

메소드 설명
_bind ( Closur\Closure $closure, string $name ) : Closur\Closure Binds the closure to the current context.
_emitFocus ( ) Applies focus up to the root.
_exception ( Exception $exception, boolean $inEachHook = false ) Manages catched exception.
_parents ( boolean $current = false ) : array. Gets all parent instances.
_skipChildren ( object $exception, boolean $emit = false ) Skips children specs(s).

메소드 상세

__call() 공개 메소드

Allow closures assigned to the scope property to be inkovable.
public __call ( string $name, array $args ) : mixed
$name string Name of the method being called.
$args array Enumerated array containing the passed arguments.
리턴 mixed

__construct() 공개 메소드

The Constructor.
public __construct ( array $config = [] )
$config array The Suite config array. Options are: -`'type'` _string_ : supported type are `'normal'` & `'focus'`. -`'message'` _string_ : the description message. -`'parent'` _object_ : the parent scope. -`'root'` _object_ : the root scope. -`'log'` _object_ : the log instance. -`'timeout'` _integer_: the timeout.

__get() 공개 메소드

Getter.
public __get ( string $key ) : mixed
$key string The name of the variable.
리턴 mixed The value of the variable.

__set() 공개 메소드

Setter.
public __set ( string $key, mixed $value ) : mixed
$key string The name of the variable.
$value mixed The value of the variable.
리턴 mixed The value of the variable.

_bind() 보호된 메소드

Binds the closure to the current context.
protected _bind ( Closur\Closure $closure, string $name ) : Closur\Closure
$closure Closur\Closure The variable to check
$name string Name of the parent type (TODO: to use somewhere).
리턴 Closur\Closure

_emitFocus() 보호된 메소드

Applies focus up to the root.
protected _emitFocus ( )

_exception() 보호된 메소드

Manages catched exception.
protected _exception ( Exception $exception, boolean $inEachHook = false )
$exception Exception The catched exception.
$inEachHook boolean Indicates if the exception occurs in a beforeEach/afterEach hook.

_parents() 보호된 메소드

Gets all parent instances.
protected _parents ( boolean $current = false ) : array.
$current boolean If `true` include `$this` to the list.
리턴 array.

_skipChildren() 보호된 메소드

Skips children specs(s).
protected _skipChildren ( object $exception, boolean $emit = false )
$exception object The exception at the origin of the skip.
$emit boolean Indicated if report events should be generated.

backtrace() 공개 메소드

Gets the backtrace array.
public backtrace ( ) : array
리턴 array

backtraceFocus() 공개 메소드

Gets/sets the regexp pattern used to removes useless traces to focus on the one related to a spec file.
public backtraceFocus ( string $pattern = null ) : string
$pattern string A wildcard pattern (i.e. `fnmatch()` style).
리턴 string The focus regexp.

current() 공개 정적인 메소드

Get the active scope instance.
public static current ( ) : Scope
리턴 Scope The object instance or `null` if there's no active instance.

excluded() 공개 메소드

Check for excluded mode.
public excluded ( ) : boolean
리턴 boolean

focused() 공개 메소드

Check for focused mode.
public focused ( ) : boolean
리턴 boolean

given() 공개 메소드

Sets a lazy loaded data.
public given ( string $name, Closur\Closure $closure ) : object
$name string The lazy loaded variable name.
$closure Closur\Closure The lazily executed closure.
리턴 object

log() 공개 메소드

It only logs expectations report.
public log ( $type = null, $data = [] )

message() 공개 메소드

Gets the spec's message.
public message ( ) : array
리턴 array

messages() 공개 메소드

Gets all messages upon the root.
public messages ( ) : array
리턴 array

parent() 공개 메소드

Gets the parent instance.
public parent ( ) : Scope
리턴 Scope

report() 공개 메소드

Send some data to reporters.
public report ( string $type, mixed $data, $byPassFocuses = false )
$type string The message type.
$data mixed The message data.

reporters() 공개 메소드

Gets the reporters container.
public reporters ( ) : object
리턴 object

skipIf() 공개 메소드

Skips specs(s) if the condition is true.
public skipIf ( boolean $condition )
$condition boolean

summary() 공개 메소드

Gets specs excecution results.
public summary ( ) : array
리턴 array

timeout() 공개 메소드

Gets/sets the timeout.
public timeout ( $timeout = null ) : integer
리턴 integer

type() 공개 메소드

Set/get the scope type.
public type ( $type = null ) : mixed
리턴 mixed

프로퍼티 상세

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

The scope backtrace.
protected object $_backtrace
리턴 object

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

A regexp pattern used to removes useless traces to focus on the one related to a spec file.
protected string $_backtraceFocus
리턴 string

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

The spec closure.
protected Closure,Closur $_closure
리턴 Closur\Closure

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

The scope's data.
protected array $_data
리턴 array

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

Count the number of failure or exception.
또한 보기: ::failfast()
protected int $_failures
리턴 integer

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

The lazy loaded scope's data.
protected array $_given
리턴 array

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

Instances stack.
protected static Scope[],kahlan $_instances
리턴 Scope[]

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

Boolean lock which avoid process() to be called in tests
protected $_locked

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

The report log of executed spec.
protected object $_log
리턴 object

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

The spec message.
protected string $_message
리턴 string

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

The parent instance.
protected Scope,kahlan $_parent
리턴 Scope

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

Stores the success value.
protected bool $_passed
리턴 boolean

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

The reporters container.
protected object $_reporters
리턴 object

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

The root instance.
protected object $_root
리턴 object

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

Indicates whether the scope has been runned or not.
protected bool $_runned
리턴 boolean

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

The execution summary instance.
protected object $_summary
리턴 object

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

The timeout value.
protected int $_timeout
리턴 integer

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

The scope type.
protected object $_type
리턴 object

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

List of reserved keywords which can't be used as scope variable.
public static array $blacklist
리턴 array