+ #!/usr/bin/env php
+ <?php
+ require 'Test.php';
+
+ plan($num); # plan $num tests
+ # or
+ plan('no_plan'); # We don't know how many
+ # or
+ plan('skip_all'); # Skip all tests
+ # or
+ plan('skip_all', $reason); # Skip all tests with a reason
+
+ diag('message in test output') # Trailing \n not required
+
+ # $test_name is always optional and should be a short description of
+ # the test, e.g. "some_function() returns an integer"
+
+ # Various ways to say "ok"
+ ok($got == $expected, $test_name);
+
+ # Compare with == and !=
+ is($got, $expected, $test_name);
+ isnt($got, $expected, $test_name);
+
+ # Run a preg regex match on some data
+ like($got, $regex, $test_name);
+ unlike($got, $regex, $test_name);
+
+ # Compare something with a given comparison operator
+ cmp_ok($got, '==', $expected, $test_name);
+ # Compare something with a comparison function (should return bool)
+ cmp_ok($got, $func, $expected, $test_name);
+
+ # Recursively check datastructures for equalness
+ is_deeply($got, $expected, $test_name);
+
+ # Always pass or fail a test under an optional name
+ pass($test_name);
+ fail($test_name);
+
+ # TODO tests, these are expected to fail but won't fail the test run,
+ # unexpected success will be reported
+ todo_start("integer arithmetic still working");
+ ok(1 + 2 == 3);
+ {
+ # TODOs can be nested
+ todo_start("string comparison still working")
+ is("foo", "bar");
+ todo_end();
+ }
+ todo_end();
+ ?>
+
+=head1 DESCRIPTION