Special module for using asserts in your tests.
param$keyparam$actualparam$description
param$keyparam$actualparam$description
Checks that haystack contains needle
param$needleparam$haystackparam string$message
Checks that variable is empty.
param$actualparam string$message
Checks that two variables are equal.
param$expectedparam$actualparam string$message
Checks that condition is negative.
param$conditionparam string$message
Checks if file exists
param string$filenameparam string$message
Checks if file doesn't exist
param string$filenameparam string$message
param$expectedparam$actualparam$description
Checks that actual is greater than expected
param$expectedparam$actualparam string$message
Checks that actual is greater or equal than expected
param$expectedparam$actualparam string$message
param$classparam$actualparam$description
param$typeparam$actualparam$description
param$actualparam$description
param$expectedparam$actualparam$description
Checks that actual is less than expected
param$expectedparam$actualparam string$message
Checks that actual is less or equal than expected
param$expectedparam$actualparam string$message
Checks that haystack doesn't contain needle.
param$needleparam$haystackparam string$message
Checks that variable is not empty.
param$actualparam string$message
Checks that two variables are not equal
param$expectedparam$actualparam string$message
param$classparam$actualparam$description
Checks that variable is not NULL
param$actualparam string$message
Checks that string not match with pattern
param string$patternparam string$stringparam string$message
Checks that two variables are not same
param$expectedparam$actualparam string$message
Checks that variable is NULL
param$actualparam string$message
Checks that string match with pattern
param string$patternparam string$stringparam string$message
Checks that two variables are same
param$expectedparam$actualparam string$messagereturnmixed|void
Checks that condition is positive.
param$conditionparam string$message
Handles and checks exception called inside callback function. Either exception class name or exception instance should be provided.
<?php
$I->expectException(MyException::class, function() {
$this->doSomethingBad();
});
$I->expectException(new MyException(), function() {
$this->doSomethingBad();
});If you want to check message or exception code, you can pass them with exception instance:
<?php
// will check that exception MyException is thrown with "Don't do bad things" message
$I->expectException(new MyException("Don't do bad things"), function() {
$this->doSomethingBad();
});param$exception string or \Exceptionparam$callback
Fails the test with message.
param$message