< PHP Errors: Normally   (Previous) Table of Contents (Next)   Side Bar Pro Tip: Avoid Spagetti Code >

PHP Errors: Execution Stops

function some_procedure() {
    echo "$nada\n";  // Execution stops here!
    return 'Hello!';
}
/**
 * @expectedException PHPUnit_Framework_Error
 * @expectedExceptionMessage Notice: Undefined variable: nada
 */
public function test_error() {
    $actual = some_procedure();
    $this->assertEquals('Hello!', $actual);  // This assertion is never run!
}