Side Bar Pro Tip: Avoid Spagetti Code
- Take advantage of PHPUnit's bailing
- Do NOT do conditional test execution
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); } }