PHP Класс pho\Runner\Runner

Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$console

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

Свойство Тип Описание
$instance

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

Метод Описание
after ( Closure $closure ) Constructs a new Hook, defining a closure to be ran after the parent suite's closure.
afterEach ( Closure $closure ) Constructs a new Hook, defining a closure to be ran prior to each of the parent suite's nested suites and specs.
before ( Closure $closure ) Constructs a new Hook, defining a closure to be ran prior to the parent suite's closure.
beforeEach ( Closure $closure ) Constructs a new Hook, defining a closure to be ran prior to each of the parent suite's nested suites and specs.
describe ( string $title, Closure $closure ) Constructs a test Suite, assigning it the given title and anonymous function. If it's a child of another suite, a reference to the parent suite is stored. This is done by tracking the current and previously defined suites.
getInstance ( ) : Runner Returns the singleton instance.
it ( string $title, Closure $closure = null ) Constructs a new Spec, adding it to the list of specs in the current suite.
run ( ) Starts the test runner by first invoking the associated reporter's beforeRun() method, then iterating over all defined suites and running their specs, and calling the reporter's afterRun() when complete.
watch ( ) Monitors the the current working directory for modifications, and reruns the specs in another process on change.
xdescribe ( string $title, Closure $closure ) Constructs a test Suite, assigning it the given title and anonymous function. If it's a child of another suite, a reference to the parent suite is stored. This is done by tracking the current and previously defined suites.
xit ( string $title, Closure $closure = null ) Constructs a new Spec, adding it to the list of specs in the current suite and mark it as pending.

Приватные методы

Метод Описание
runAfterEachHooks ( pho\Suite\Suite $suite ) Runs the afterEach hooks of the given suite and its parent suites recursively. They are ran in the order in the opposite order, from inner suites to outer suites.
runBeforeEachHooks ( pho\Suite\Suite $suite ) Runs the beforeEach hooks of the given suite and its parent suites recursively. They are ran in the order in which they were defined, from outer suite to inner suites.
runRunnable ( $runnable ) A short helper method that calls an object's run() method only if it's an instance of Runnable.
runSpecs ( pho\Suite\Suite $suite ) Runs the specs associated with the provided test suite. It iterates over and runs each spec, calling the reporter's beforeSpec and afterSpec methods, as well as the suite's beforeEach and aferEach hooks. If the filter option is used, only specs containing a pattern are ran. And if the stop flag is used, it quits when an exception or error is thrown.
runSuite ( pho\Suite\Suite $suite ) Runs a particular suite by running the associated hooks and reporter, methods, iterating over its child suites and recursively calling itself, followed by running its specs.

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

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

Constructs a new Hook, defining a closure to be ran after the parent suite's closure.
public after ( Closure $closure )
$closure Closure The closure to be ran after the suite

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

Constructs a new Hook, defining a closure to be ran prior to each of the parent suite's nested suites and specs.
public afterEach ( Closure $closure )
$closure Closure The closure to be ran after each spec

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

Constructs a new Hook, defining a closure to be ran prior to the parent suite's closure.
public before ( Closure $closure )
$closure Closure The closure to be ran before the suite

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

Constructs a new Hook, defining a closure to be ran prior to each of the parent suite's nested suites and specs.
public beforeEach ( Closure $closure )
$closure Closure The closure to be ran before each spec

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

Constructs a test Suite, assigning it the given title and anonymous function. If it's a child of another suite, a reference to the parent suite is stored. This is done by tracking the current and previously defined suites.
public describe ( string $title, Closure $closure )
$title string A title to be associated with the suite
$closure Closure The closure to invoke when the suite is ran

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

Returns the singleton instance.
public static getInstance ( ) : Runner
Результат Runner The singleton instance

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

Constructs a new Spec, adding it to the list of specs in the current suite.
public it ( string $title, Closure $closure = null )
$title string A title to be associated with the spec
$closure Closure The closure to invoke when the spec is ran

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

Starts the test runner by first invoking the associated reporter's beforeRun() method, then iterating over all defined suites and running their specs, and calling the reporter's afterRun() when complete.
public run ( )

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

Monitors the the current working directory for modifications, and reruns the specs in another process on change.
public watch ( )

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

After all, mark the Suit as pending.
public xdescribe ( string $title, Closure $closure )
$title string A title to be associated with the suite
$closure Closure The closure to invoke when the suite is ran

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

Constructs a new Spec, adding it to the list of specs in the current suite and mark it as pending.
public xit ( string $title, Closure $closure = null )
$title string A title to be associated with the spec
$closure Closure The closure to invoke when the spec is ran

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

$console публичное статическое свойство

public static $console

$instance защищенное статическое свойство

protected static $instance