PHP Класс RedUNIT\RedUNIT

Автор: Gabor de Mooij
Показать файл Открыть проект

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

Свойство Тип Описание
$currentlyActiveDriverID string
$round integer

Открытые методы

Метод Описание
cleanUp ( ) : void Clean-up method, to be invoked after running the test.
getRound ( ) : integer Returns the current round number.
getTargetDrivers ( ) : array What drivers should be loaded for this test pack ? This method should be implemented by the test to tell the test controller system what drivers are supposed to be tested.
isFirstRound ( ) : boolean Detects whether the current round is the first one.
prepare ( ) Prepare test pack (mostly: nuke the entire database).
run ( ) : void Runs the test. This method will run the tests implemented by the RedUNIT instance. The run method scans its class for all public instance methods except: run (to avoid recursion), getTargetDrivers, onEvent and prepare. -- added cleanUp/prepare just in case they get overridden.
setCurrentDriver ( string $driver ) : void Sets the current driver.
setRound ( integer $roundNumber ) : void Sets the round number.

Описание методов

cleanUp() публичный Метод

This is an empty implementation, it does nothing. However this method should be overridden by tests that require clean-up.
public cleanUp ( ) : void
Результат void

getRound() публичный Метод

The current round number indicates how many times this test has been applied (to various drivers).
public getRound ( ) : integer
Результат integer

getTargetDrivers() абстрактный публичный Метод

Each driver will be fed to the test in a 'round' (explained below).
abstract public getTargetDrivers ( ) : array
Результат array

isFirstRound() публичный Метод

If the current round is indeed the first round, this method will return boolean TRUE, otherwise it will return FALSE. Note that the rounds are 0-based, so - if the current round equals 0, this method will return TRUE.
public isFirstRound ( ) : boolean
Результат boolean

prepare() публичный Метод

This method prepares the test for a run.
public prepare ( )

run() публичный Метод

Runs the test. This method will run the tests implemented by the RedUNIT instance. The run method scans its class for all public instance methods except: run (to avoid recursion), getTargetDrivers, onEvent and prepare. -- added cleanUp/prepare just in case they get overridden.
public run ( ) : void
Результат void

setCurrentDriver() публичный Метод

This method is called by a test controller, runner or manager to activate the mode associated with the specified driver identifier. This mechanism allows a test to run slightly different in the context of another driver, for instance SQLite might not need some tests, or MySQL might need some additional tests etc...
public setCurrentDriver ( string $driver ) : void
$driver string the driver identifier
Результат void

setRound() публичный Метод

Each test can have a varying number of flavors. A test flavor is 'that same test' but for a different driver. Each 'run on a specific driver' is called a round. Some tests might want to know what the current round is. This method can be used to set the current round number.
public setRound ( integer $roundNumber ) : void
$roundNumber integer round, the current round number
Результат void

Описание свойств

$currentlyActiveDriverID защищенное свойство

protected string $currentlyActiveDriverID
Результат string

$round защищенное свойство

protected int $round
Результат integer