re-organize test files, make it easy to test for both php 5.2 and 5.3
This commit is contained in:
19
simpletest/ErrorTest_53.php
Normal file
19
simpletest/ErrorTest_53.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?
|
||||
class ErrorTest_53 extends SimpleTest {
|
||||
function test_1_error_handler() {
|
||||
global $anonymous_error_callback_worked;
|
||||
|
||||
DB::$throw_exception_on_error = false;
|
||||
DB::$error_handler = function($params) {
|
||||
global $anonymous_error_callback_worked;
|
||||
if (substr_count($params['error'], 'You have an error in your SQL syntax')) $anonymous_error_callback_worked = 1;
|
||||
};
|
||||
DB::query("SELET * FROM accounts");
|
||||
$this->assert($anonymous_error_callback_worked === 1);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user