Skip to content

Commit

Permalink
Fix warning in tests on PHP5.2.3 < . Avoid test for call_if_exists wi…
Browse files Browse the repository at this point in the history
…th static class method call.
  • Loading branch information
Fabrice Luraine authored and CBeerta committed May 30, 2011
1 parent 125248a commit dc8c198
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/main.php
Expand Up @@ -108,7 +108,10 @@ static public function testStatic($value=1)
$obj = new TestCallIfExists(); $obj = new TestCallIfExists();
assert_equal(call_if_exists(array($obj, 'test'), 3), 30); assert_equal(call_if_exists(array($obj, 'test'), 3), 30);
assert_equal(call_if_exists(array('TestCallIfExists', 'testStatic'), 3), 60); assert_equal(call_if_exists(array('TestCallIfExists', 'testStatic'), 3), 60);
assert_equal(call_if_exists('TestCallIfExists::testStatic', 3), 60); if(version_compare(PHP_VERSION, '5.2.3', '>='))
{
assert_equal(call_if_exists('TestCallIfExists::testStatic', 3), 60);
}
} }


function test_main_define_unless_exists() function test_main_define_unless_exists()
Expand Down

0 comments on commit dc8c198

Please sign in to comment.