From 114ab0988e20ac6be39ad363ff897a1a3b85e565 Mon Sep 17 00:00:00 2001
From: Razican 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 4b9c62980599228f070b401c7673dce8085b0c61 Mon Sep 17 00:00:00 2001
From: Derek Jones
Date: Fri, 1 Jul 2011 17:40:48 -0500
Subject: backed out 648b42a75739, which was a NON-trivial whitespace commit.
It broke the Typography class's string replacements, for instance
---
user_guide/libraries/unit_testing.html | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
(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 a4305129f..5e0c4c16b 100644
--- a/user_guide/libraries/unit_testing.html
+++ b/user_guide/libraries/unit_testing.html
@@ -92,7 +92,7 @@ $test_name = 'Adds one plus one';
$this->unit->run($test, $expected_result, $test_name);
-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:
$this->unit->run('Foo', 'Foo');
@@ -100,8 +100,8 @@ $this->unit->run($test, $expected_result, $test_name);
$this->unit->run('Foo', 'is_string');
-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:
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