Class CIUnitTestCase

Summary

Fully Qualified Name: CodeIgniter\Test\CIUnitTestCase
Extends: TestCase

Description

PHPunit test case.

Methods

Name Description Defined By
assertCloseEnough() Custom function to test that two values are "close enough". CIUnitTestCase
assertCloseEnoughString() Custom function to test that two values are "close enough". CIUnitTestCase
assertEventTriggered() Hooks into CodeIgniter's Events system to check if a specific event was triggered or not. CIUnitTestCase
assertHeaderEmitted() Hooks into xdebug's headers capture, looking for a specific header emitted CIUnitTestCase
assertHeaderNotEmitted() Hooks into xdebug's headers capture, looking for a specific header emitted CIUnitTestCase
assertLogged() Custom function to hook into CodeIgniter's Logging mechanism to check if certain messages were logged during code execution. CIUnitTestCase

Method Details

assertCloseEnough()

Custom function to test that two values are "close enough".

This is intended for extended execution time testing, where the result is close but not exactly equal to the expected time, for reasons beyond our control.

Parameter Name Type Description
$expected int
$actual mixed
$message string
$tolerance int

Returns:

assertCloseEnoughString()

Custom function to test that two values are "close enough".

This is intended for extended execution time testing, where the result is close but not exactly equal to the expected time, for reasons beyond our control.

Parameter Name Type Description
$expected mixed
$actual mixed
$message string
$tolerance int

Returns: bool

assertEventTriggered()

Hooks into CodeIgniter's Events system to check if a specific event was triggered or not.

Parameter Name Type Description
$eventName string

Returns: bool

assertHeaderEmitted()

Hooks into xdebug's headers capture, looking for a specific header emitted

Parameter Name Type Description
$header string The
$ignoreCase bool

Returns:

assertHeaderNotEmitted()

Hooks into xdebug's headers capture, looking for a specific header emitted

Parameter Name Type Description
$header string The
$ignoreCase bool

Returns:

assertLogged()

Custom function to hook into CodeIgniter's Logging mechanism to check if certain messages were logged during code execution.

Parameter Name Type Description
$level string
$expectedMessage null

Returns: bool

Top