class CI_Unit_test
-
set_test_items($items)
-
Parameters: - $items (array) – List of visible test items
Returns: void
Sets a list of items that should be visible in tests. Valid options are:
- test_name
- test_datatype
- res_datatype
- result
- file
- line
- notes
-
run($test[, $expected = TRUE[, $test_name = 'undefined'[, $notes = '']]])
-
Parameters: - $test (mixed) – Test data
- $expected (mixed) – Expected result
- $test_name (string) – Test name
- $notes (string) – Any notes to be attached to the test
Returns: Test report
Return type: string
Runs unit tests.
-
report([$result = array()])
-
Parameters: - $result (array) – Array containing tests results
Returns: Test report
Return type: string
Generates a report about already complete tests.
-
use_strict([$state = TRUE])
-
Parameters: - $state (bool) – Strict state flag
Return type: void
Enables/disables strict type comparison in tests.
-
active([$state = TRUE])
-
Parameters: - $state (bool) – Whether to enable testing
Return type: void
Enables/disables unit testing.
-
result([$results = array()])
-
Parameters: - $results (array) – Tests results list
Returns: Array of raw result data
Return type: array
Returns raw tests results data.
-
set_template($template)
-
Parameters: - $template (string) – Test result template
Return type: void
Sets the template for displaying tests results.
Please login to continue.