Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Unit Testing question
  • After I installed PHPUnit, I ran oil test. I got these errors. Tests Running...This may take a few moments.
    PHPUnit 3.7.8 by Sebastian Bergmann. Configuration read from /home/hewenxiang/htdocs/blog/fuel/core/phpunit.xml FFFFFFFF.....FFFF.F.F.....F.................................... 63 / 306 ( 20%)
    .....................................................FF........ 126 / 306 ( 41%)
    ............................................................... 189 / 306 ( 61%)
    ..............F............E................................... 252 / 306 ( 82%)
    ................................................FF.... Time: 3 seconds, Memory: 14.25Mb There was 1 error: 1) Fuel\Core\Test_Num::test_bytes
    Exception: The byte unit size, "200K", is improperly formatted. /home/hewenxiang/htdocs/blog/fuel/core/classes/num.php:93
    /home/hewenxiang/htdocs/blog/fuel/core/tests/num.php:32 --
    There were 20 failures: 1) Fuel\Core\Test_Agent::test_browser
    Failed asserting that two strings are equal.
    --- Expected
    +++ Actual
    @@ @@
    -'Firefox'
    +'unknown' /home/hewenxiang/htdocs/blog/fuel/core/tests/agent.php:43 2) Fuel\Core\Test_Agent::test_platform
    Failed asserting that two strings are equal.
    --- Expected
    +++ Actual
    @@ @@
    -'Linux'
    +'unknown' /home/hewenxiang/htdocs/blog/fuel/core/tests/agent.php:55 3) Fuel\Core\Test_Agent::test_version
    Failed asserting that 0 is of type "float". /home/hewenxiang/htdocs/blog/fuel/core/tests/agent.php:67 4) Fuel\Core\Test_Agent::test_property with data set #0 ('Browser', 'Firefox')
    Failed asserting that two strings are equal.
    --- Expected
    +++ Actual
    @@ @@
    -'Firefox'
    +'unknown' /home/hewenxiang/htdocs/blog/fuel/core/tests/agent.php:161 5) Fuel\Core\Test_Agent::test_property with data set #1 ('Version', 3.6)
    Failed asserting that 0 matches expected 3.6. /home/hewenxiang/htdocs/blog/fuel/core/tests/agent.php:161 6) Fuel\Core\Test_Agent::test_property with data set #2 ('MajorVer', 3)
    Failed asserting that 0 matches expected 3. /home/hewenxiang/htdocs/blog/fuel/core/tests/agent.php:161 7) Fuel\Core\Test_Agent::test_property with data set #3 ('MinorVer', 6)
    Failed asserting that 0 matches expected 6. /home/hewenxiang/htdocs/blog/fuel/core/tests/agent.php:161 8) Fuel\Core\Test_Agent::test_property with data set #4 ('Platform', 'Linux')
    Failed asserting that two strings are equal.
    --- Expected
    +++ Actual
    @@ @@
    -'Linux'
    +'unknown' /home/hewenxiang/htdocs/blog/fuel/core/tests/agent.php:161 9) Fuel\Core\Test_Agent::test_property with data set #10 ('Frames', true)
    Failed asserting that false matches expected true. /home/hewenxiang/htdocs/blog/fuel/core/tests/agent.php:161 10) Fuel\Core\Test_Agent::test_property with data set #11 ('IFrames', true)
    Failed asserting that false matches expected true. /home/hewenxiang/htdocs/blog/fuel/core/tests/agent.php:161 11) Fuel\Core\Test_Agent::test_property with data set #12 ('Tables', true)
    Failed asserting that false matches expected true. /home/hewenxiang/htdocs/blog/fuel/core/tests/agent.php:161 12) Fuel\Core\Test_Agent::test_property with data set #13 ('Cookies', true)
    Failed asserting that false matches expected true. /home/hewenxiang/htdocs/blog/fuel/core/tests/agent.php:161 13) Fuel\Core\Test_Agent::test_property with data set #15 ('JavaScript', true)
    Failed asserting that false matches expected true. /home/hewenxiang/htdocs/blog/fuel/core/tests/agent.php:161 14) Fuel\Core\Test_Agent::test_property with data set #17 ('JavaApplets', true)
    Failed asserting that false matches expected true. /home/hewenxiang/htdocs/blog/fuel/core/tests/agent.php:161 15) Fuel\Core\Test_Agent::test_property with data set #23 ('CssVersion', 3)
    Failed asserting that 0 matches expected 3. /home/hewenxiang/htdocs/blog/fuel/core/tests/agent.php:161 16) Fuel\Core\Test_Date::test_time_ago_one_month
    Failed asserting that null matches expected '1 month ago'. /home/hewenxiang/htdocs/blog/fuel/core/tests/date.php:121 17) Fuel\Core\Test_Date::test_time_ago_two_months
    Failed asserting that null matches expected '2 months ago'. /home/hewenxiang/htdocs/blog/fuel/core/tests/date.php:136 18) Fuel\Core\Test_Lang::test_line
    Failed asserting that null matches expected 'Hello there Bob!'. /home/hewenxiang/htdocs/blog/fuel/core/tests/lang.php:34 19) Fuel\Core\Test_Validation::test_validation_valid_string_multiple_flags_error_message_add_rule
    Failed asserting that two strings are equal.
    --- Expected
    +++ Actual
    @@ @@
    -'The valid string rule valid_string(alpha, numeric) failed for field F1'
    +'Validation rule valid_string failed for F1' /home/hewenxiang/htdocs/blog/fuel/core/tests/validation.php:627 20) Fuel\Core\Test_Validation::test_validation_valid_string_multiple_flags_error_message_add_field
    Failed asserting that two strings are equal.
    --- Expected
    +++ Actual
    @@ @@
    -'The valid string rule valid_string(alpha, numeric) failed for field F1'
    +'Validation rule valid_string failed for F1' /home/hewenxiang/htdocs/blog/fuel/core/tests/validation.php:646 FAILURES!
    Tests: 306, Assertions: 268, Failures: 20, Errors: 1.
  • The Agent results might be related to the fact that the browscap project is dead. We're looking for a fix for that. I'll have a look at the other ones.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion