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

PHP Errors: But What if I WANT to Continue?

abstract class TestCase extends PHPUnit_Framework_TestCase {

    public function expected_errors_handler($errno, $errstr) {
        foreach ($this->expected_error_list as $expect) {
            if (strpos($errstr, $expect) !== false) {
                $this->expected_errors_found = true;
                return true;
            }
        }
        return false;
    }
}