< PHP Errors: Execution Stops   (Previous) Table of Contents (Next)   PHP Errors: But What if I WANT to Continue? >

Side Bar Pro Tip: Avoid Spagetti Code

public function test_error() {
    $actual = get_given_value(FALSE);

    // $actual is FALSE.  Method execution stops.
    $this->assertTrue($actual);

    // Hey test authors, for heaven's sake, don't write tests like this...
    if ($actual) {
        $other = do_something_with_result($actual);
        $this->assertTrue($other);
    }
}