From 0e3263b44d2762894588ff3e682579ec0cb77fa0 Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Thu, 10 Mar 2011 16:37:35 +0000 Subject: Updated version number in User Guide html. --- 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 49c5881e1..e68bc3fde 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.0

CodeIgniter User Guide Version 2.0.1

-- cgit v1.2.3-24-g4f1b From 1f622294b92c095fd91e8ca44912d405c1605ded Mon Sep 17 00:00:00 2001 From: Pascal Kriete Date: Thu, 7 Apr 2011 12:06:51 -0400 Subject: Wow, I screwed that up, Reactor is going to 2.0.2 not 2.0.1 --- 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 e68bc3fde..5e0c4c16b 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.1

CodeIgniter User Guide Version 2.0.2

-- cgit v1.2.3-24-g4f1b From 114ab0988e20ac6be39ad363ff897a1a3b85e565 Mon Sep 17 00:00:00 2001 From: Razican Date: Mon, 25 Apr 2011 17:26:45 +0200 Subject: Fixed double-space typo. --- 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 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';

$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:

  • is_object
  • @@ -129,18 +129,18 @@ To show a report directly simply echo or return the run function:

    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();

    Strict Mode

    -

    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->

    Creating a Template

    -

    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