PHP 클래스 Namshi\AB\Container

상속: implements ArrayAcces\ArrayAccess, implements Countabl\Countable, implements IteratorAggregat\IteratorAggregate
파일 보기 프로젝트 열기: namshi/ab 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$seed
$tests

공개 메소드들

메소드 설명
__construct ( array $tests = [], integer $seed = null ) Constructor
add ( Test $test ) Adds a new $test.
count ( ) : integer Returns how many tests have been registered in this container.
createTest ( string $name, array $variations = [], array $parameters = [] ) : Test Creates, registers and returns a test with the given parameters.
disableTests ( ) Convenient method to disable all the tests registered with this container at once.
get ( string $test ) : Test Returns a test with the name $test.
getAll ( ) : array Returns all the tests registered in the container.
getIterator ( ) : ArrayIterator Returns the iterator to use to iterate over the container.
getSeed ( ) : integer Get the seed to be passed to each test.
offsetExists ( string $offset ) : boolean Checks whether a test is registered.
offsetGet ( string $offset ) : Test | null Returns a test, or null if the test was not found.
offsetSet ( string $offset, Test $value ) Registers a test.
offsetUnset ( string $offset ) Unregisters a test.
runTests ( ) Convenient method to run all the tests registered with this container at once.
setSeed ( integer $seed ) Sets the seed to be passed to each test.

보호된 메소드들

메소드 설명
calculateTestSeed ( integer $globalSeed, Test $test ) : integer Calculates a seed for the given $test, mixing the global seed and a numerical representation of the test name.

메소드 상세

__construct() 공개 메소드

Constructor
public __construct ( array $tests = [], integer $seed = null )
$tests array
$seed integer

add() 공개 메소드

Adds a new $test.
public add ( Test $test )
$test Test

calculateTestSeed() 보호된 메소드

Calculates a seed for the given $test, mixing the global seed and a numerical representation of the test name.
protected calculateTestSeed ( integer $globalSeed, Test $test ) : integer
$globalSeed integer
$test Test
리턴 integer

count() 공개 메소드

Returns how many tests have been registered in this container.
public count ( ) : integer
리턴 integer

createTest() 공개 메소드

Creates, registers and returns a test with the given parameters.
public createTest ( string $name, array $variations = [], array $parameters = [] ) : Test
$name string
$variations array
$parameters array
리턴 Test

disableTests() 공개 메소드

Convenient method to disable all the tests registered with this container at once.
public disableTests ( )

get() 공개 메소드

Returns a test with the name $test.
public get ( string $test ) : Test
$test string
리턴 Test

getAll() 공개 메소드

Returns all the tests registered in the container.
public getAll ( ) : array
리턴 array

getIterator() 공개 메소드

Returns the iterator to use to iterate over the container.

getSeed() 공개 메소드

Get the seed to be passed to each test.
public getSeed ( ) : integer
리턴 integer

offsetExists() 공개 메소드

Checks whether a test is registered.
public offsetExists ( string $offset ) : boolean
$offset string
리턴 boolean

offsetGet() 공개 메소드

Returns a test, or null if the test was not found.
public offsetGet ( string $offset ) : Test | null
$offset string
리턴 Test | null

offsetSet() 공개 메소드

Registers a test.
public offsetSet ( string $offset, Test $value )
$offset string
$value Test

offsetUnset() 공개 메소드

Unregisters a test.
public offsetUnset ( string $offset )
$offset string

runTests() 공개 메소드

Convenient method to run all the tests registered with this container at once.
public runTests ( )

setSeed() 공개 메소드

Sets the seed to be passed to each test.
public setSeed ( integer $seed )
$seed integer

프로퍼티 상세

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

protected $seed

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

protected $tests