A named suite of test cases that are executed altogether. The suite suite is created with the @see \io\vertx\jphp\ext\unit\TestSuite::create and the returned suite contains initially no tests.<p/>
The suite can declare a callback before the suite with @see \io\vertx\jphp\ext\unit\TestSuite::before or after the suite with @see \io\vertx\jphp\ext\unit\TestSuite::after.
The suite can declare a callback before each test with @see \io\vertx\jphp\ext\unit\TestSuite::beforeEach or after each test with @see \io\vertx\jphp\ext\unit\TestSuite::afterEach.
Each test case of the suite is declared by calling the @see \io\vertx\jphp\ext\unit\TestSuite::test method.
package |
Default |
---|
__construct()
after( $arg0) : $this
callable
$this
a reference to this, so the API can be used fluently
afterEach( $arg0) : $this
callable
$this
a reference to this, so the API can be used fluently
before( $arg0) : $this
callable
$this
a reference to this, so the API can be used fluently
beforeEach( $arg0) : $this
callable
$this
a reference to this, so the API can be used fluently
create( $arg0) : \io\vertx\jphp\ext\unit\TestSuite
run( $arg0 = null, $arg1 = null) : \io\vertx\jphp\ext\unit\TestCompletion
When the test suite is executed in a Vertx context (i.e Vertx.currentContext()
returns a context) this
context's event loop is used for running the test suite. Otherwise it is executed in the current thread.
The returned @see \io\vertx\jphp\ext\unit\Completion object can be used to get a completion callback.
run()
Run the testsuite with the specified options
.
When the test suite is executed in a Vertx context (i.e Vertx.currentContext()
returns a context) this
context's event loop is used for running the test suite unless the @see \io\vertx\jphp\ext\unit\TestOptions
is set to false
. In this case it is executed by the current thread.
Otherwise, the test suite will be executed in the current thread when @see \io\vertx\jphp\ext\unit\TestOptions is
set to false
or null
. If the value is true
, this methods throws an IllegalStateException
.
The returned @see \io\vertx\jphp\ext\unit\Completion object can be used to get a completion callback.
param $options [TestOptions | array] the test options run($options)
Run the testsuite with the default options and the specified vertx
instance.
The test suite will be executed on the event loop provided by the vertx
argument. The returned
see |
\io\vertx\jphp\ext\unit\Completion
object can be used to get a completion callback. param $vertx [Vertx] the vertx instance run($vertx) Run the testsuite with the specified The test suite will be executed on the event loop provided by the is not set to object can be used to get a completion callback. param $vertx [Vertx] the vertx instance param $options [TestOptions | array] the test options run($vertx, $options) |
---|
TestOptions | array | Vertx
TestOptions | array
\io\vertx\jphp\ext\unit\TestCompletion
the related test completion
test( $arg0, $arg1, $arg2 = null) : $this
param $name [string] the test case name param $testCase [callable] the test case test($name, $testCase)
Add a new test case to the suite.
param $name [string] the test case name param $repeat [integer] the number of times the test should be repeated param $testCase [callable] the test case test($name, $repeat, $testCase)
string
callable | integer
callable
$this
a reference to this, so the API can be used fluently