Skip to content
brianium edited this page Dec 24, 2014 · 4 revisions

Peridot tests fail if an exception is thrown at any point in it's execution, i.e setup, the test definition or tear down.

This makes assertions easy. The default DSL included with Peridot adds a callback to the native assert function to throw exceptions when an assertion fails:

assert_options(ASSERT_CALLBACK, function ($script, $line, $message, $description) {
    throw new Exception($description);
});

However, many people prefer the use of matcher libraries that expose an interface like:

expect($result)->toBe(true);

We wrote a matcher library of our own known as Leo, and we think you will find it most enjoyable. If Leo is not to your liking, there are plenty of other options out there.

Clone this wiki locally