From 4b9c62980599228f070b401c7673dce8085b0c61 Mon Sep 17 00:00:00 2001
From: Derek Jones The expected result you supply can either be a literal match, or a data type match. Here's an example of a literal: The expected result you supply can either be a literal match, or a data type match. Here's an example of a literal: Notice the use of "is_string" in the second parameter? This tells the function to evaluate whether your test is producing a string
-as the result. Here is a list of allowed comparison types: Notice the use of "is_string" in the second parameter? This tells the function to evaluate whether your test is producing a string
+as the result. Here is a list of allowed comparison types:
$this->unit->run($test, $expected_result, $test_name);
-$this->unit->run('Foo', 'Foo');
@@ -100,8 +100,8 @@ $this->unit->run($test, $expected_result, $test_name);
$this->unit->run('Foo', 'is_string');
-
echo $this->unit->report();
-The report will be formatted in an HTML table for viewing. If you prefer the raw data you can retrieve an array using:
+The report will be formatted in an HTML table for viewing. If you prefer the raw data you can retrieve an array using:
echo $this->unit->result();
By default the unit test class evaluates literal matches loosely. Consider this example:
+By default the unit test class evaluates literal matches loosely. Consider this example:
$this->unit->run(1, TRUE);
-The test is evaluating an integer, but the expected result is a boolean. PHP, however, due to it's loose data-typing +
The test is evaluating an integer, but the expected result is a boolean. PHP, however, due to it's loose data-typing will evaluate the above code as TRUE using a normal equality test:
if (1 == TRUE) echo 'This evaluates as true';
@@ -184,8 +184,8 @@ You can customize which of these items get displayed by using $this->unit->
If you would like your test results formatted differently then the default you can set your own template. Here is an -example of a simple template. Note the required pseudo-variables:
+If you would like your test results formatted differently then the default you can set your own template. Here is an +example of a simple template. Note the required pseudo-variables:
$str = '
--
cgit v1.2.3-24-g4f1b
From b8c038a3e7742f32915d7f1ab69627075e8d0c39 Mon Sep 17 00:00:00 2001
From: Derek Jones
Date: Sat, 20 Aug 2011 08:57:14 -0500
Subject: updated version number in user guide, removed some stray merge
markers found in the change log
---
user_guide/libraries/unit_testing.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'user_guide/libraries/unit_testing.html')
diff --git a/user_guide/libraries/unit_testing.html b/user_guide/libraries/unit_testing.html
index 5e0c4c16b..5ebec0cbf 100644
--- a/user_guide/libraries/unit_testing.html
+++ b/user_guide/libraries/unit_testing.html
@@ -28,7 +28,7 @@
-CodeIgniter User Guide Version 2.0.2
+CodeIgniter User Guide Version 2.0.3
Table of Contents Page
--
cgit v1.2.3-24-g4f1b