diff options
author | Greg Aker <greg.aker@ellislab.com> | 2011-04-27 08:47:47 +0200 |
---|---|---|
committer | Greg Aker <greg.aker@ellislab.com> | 2011-04-27 08:47:47 +0200 |
commit | a6507905578f1cf209776ae3d53099a005a06823 (patch) | |
tree | 9f23bb557f920034cf65c86059c84e37efd34d79 /user_guide/libraries/unit_testing.html | |
parent | 60ef4ea72e169e174ff8dbb421609a178a3c0c48 (diff) | |
parent | 25d495b4a2598f771a858108a2cd2e96f0130412 (diff) |
merging in changes
Diffstat (limited to 'user_guide/libraries/unit_testing.html')
-rw-r--r-- | user_guide/libraries/unit_testing.html | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/user_guide/libraries/unit_testing.html b/user_guide/libraries/unit_testing.html index 5e0c4c16b..a4305129f 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';<br /> <br /> $this->unit->run($test, $expected_result, $test_name);</code> -<p>The expected result you supply can either be a literal match, or a data type match. Here's an example of a literal:</p> +<p>The expected result you supply can either be a literal match, or a data type match. Here's an example of a literal:</p> <code>$this->unit->run('Foo', 'Foo');</code> @@ -100,8 +100,8 @@ $this->unit->run($test, $expected_result, $test_name);</code> <code>$this->unit->run('Foo', 'is_string');</code> -<p>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:</p> +<p>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:</p> <ul> <li>is_object</li> @@ -129,18 +129,18 @@ To show a report directly simply echo or return the <var>run</var> function:</p> <code>echo $this->unit->report();</code> -<p>The report will be formatted in an HTML table for viewing. If you prefer the raw data you can retrieve an array using:</p> +<p>The report will be formatted in an HTML table for viewing. If you prefer the raw data you can retrieve an array using:</p> <code>echo $this->unit->result();</code> <h2>Strict Mode</h2> -<p>By default the unit test class evaluates literal matches loosely. Consider this example:</p> +<p>By default the unit test class evaluates literal matches loosely. Consider this example:</p> <code>$this->unit->run(1, TRUE);</code> -<p>The test is evaluating an integer, but the expected result is a boolean. PHP, however, due to it's loose data-typing +<p>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:</p> <code>if (1 == TRUE) echo 'This evaluates as true';</code> @@ -184,8 +184,8 @@ You can customize which of these items get displayed by using <kbd>$this->unit-> <h3>Creating a Template</h3> -<p>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:</p> +<p>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:</p> <code> $str = '<br /> |