| Fully Qualified Name: | CodeIgniter\Test\FeatureTestCase |
| Extends: | CIDatabaseTestCase |
Class FeatureTestCase
Provides additional utilities for doing full HTTP testing against your application.
| 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 |
| call() | Calls a single URI, executes it, and returns a FeatureResponse instance that can be used to run many assertions against. | FeatureTestCase |
| delete() | Performs a DELETE request. | FeatureTestCase |
| dontSeeInDatabase() | Asserts that records that match the conditions in $where do not exist in the database. | CIDatabaseTestCase |
| get() | Performs a GET request. | FeatureTestCase |
| grabFromDatabase() | Fetches a single column from a database row with criteria matching $where. | CIDatabaseTestCase |
| hasInDatabase() | Inserts a row into to the database. This row will be removed after the test has run. | CIDatabaseTestCase |
| loadDependencies() | Load any database test dependencies. | CIDatabaseTestCase |
| options() | Performs an OPTIONS request. | FeatureTestCase |
| patch() | Performss a PATCH request | FeatureTestCase |
| post() | Performs a POST request. | FeatureTestCase |
| put() | Performs a PUT request | FeatureTestCase |
| seeInDatabase() | Asserts that records that match the conditions in $where DO exist in the database. | CIDatabaseTestCase |
| seeNumRecords() | Asserts that the number of rows in the database that match $where is equal to $expected. | CIDatabaseTestCase |
| seed() | Seeds that database with a specific seeder. | CIDatabaseTestCase |
| skipEvents() | Don't run any events while running this test. | FeatureTestCase |
| withSession() | Sets any values that should exist during this session. | FeatureTestCase |
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:
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
Hooks into CodeIgniter's Events system to check if a specific event was triggered or not.
| Parameter Name | Type | Description |
|---|---|---|
| $eventName | string |
Returns: bool
Hooks into xdebug's headers capture, looking for a specific header emitted
| Parameter Name | Type | Description |
|---|---|---|
| $header | string | The |
| $ignoreCase | bool |
Returns:
Hooks into xdebug's headers capture, looking for a specific header emitted
| Parameter Name | Type | Description |
|---|---|---|
| $header | string | The |
| $ignoreCase | bool |
Returns:
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
Calls a single URI, executes it, and returns a FeatureResponse instance that can be used to run many assertions against.
| Parameter Name | Type | Description |
|---|---|---|
| $method | string | |
| $path | string | |
| $params | array|null |
Returns: \CodeIgniter\Test\FeatureResponse
Performs a DELETE request.
| Parameter Name | Type | Description |
|---|---|---|
| $path | string | |
| $params | array|null |
Returns: \CodeIgniter\Test\FeatureResponse
Asserts that records that match the conditions in $where do not exist in the database.
| Parameter Name | Type | Description |
|---|---|---|
| $table | string | |
| $where | array |
Returns: bool
Performs a GET request.
| Parameter Name | Type | Description |
|---|---|---|
| $path | string | |
| $params | array|null |
Returns: \CodeIgniter\Test\FeatureResponse
Fetches a single column from a database row with criteria matching $where.
| Parameter Name | Type | Description |
|---|---|---|
| $table | string | |
| $column | string | |
| $where | array |
Returns: bool
Inserts a row into to the database. This row will be removed after the test has run.
| Parameter Name | Type | Description |
|---|---|---|
| $table | string | |
| $data | array |
Returns: bool
Load any database test dependencies.
Returns:
Performs an OPTIONS request.
| Parameter Name | Type | Description |
|---|---|---|
| $path | string | |
| $params | array|null |
Returns: \CodeIgniter\Test\FeatureResponse
Performss a PATCH request
| Parameter Name | Type | Description |
|---|---|---|
| $path | string | |
| $params | array|null |
Returns: \CodeIgniter\Test\FeatureResponse
Performs a POST request.
| Parameter Name | Type | Description |
|---|---|---|
| $path | string | |
| $params | array|null |
Returns: \CodeIgniter\Test\FeatureResponse
Performs a PUT request
| Parameter Name | Type | Description |
|---|---|---|
| $path | string | |
| $params | array|null |
Returns: \CodeIgniter\Test\FeatureResponse
Asserts that records that match the conditions in $where DO exist in the database.
| Parameter Name | Type | Description |
|---|---|---|
| $table | string | |
| $where | array |
Returns: bool
Asserts that the number of rows in the database that match $where is equal to $expected.
| Parameter Name | Type | Description |
|---|---|---|
| $expected | int | |
| $table | string | |
| $where | array |
Returns: bool
Seeds that database with a specific seeder.
| Parameter Name | Type | Description |
|---|---|---|
| $name | string |
Returns:
Don't run any events while running this test.
Returns: $this
Sets any values that should exist during this session.
| Parameter Name | Type | Description |
|---|---|---|
| $values | array |
Returns: $this