PHP Класс Namshi\AB\Container

Наследование: implements ArrayAcces\ArrayAccess, implements Countabl\Countable, implements IteratorAggregat\IteratorAggregate
Показать файл Открыть проект Примеры использования класса

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

Свойство Тип Описание
$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.
public getIterator ( ) : ArrayIterator
Результат ArrayIterator

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