add another queryWalk() test case

make sure we're using $is_buffered=false for queryWalk() like we're supposed to
This commit is contained in:
Sergey Tsalkov
2021-08-14 05:08:41 +00:00
parent 7febdbd1f5
commit f82f0cc208

View File

@@ -45,4 +45,20 @@ class WalkTest extends SimpleTest {
// if $Walk hasn't been properly freed, this will produce an out of sync error // if $Walk hasn't been properly freed, this will produce an out of sync error
DB::query("SELECT * FROM accounts"); DB::query("SELECT * FROM accounts");
} }
function test_5_walk_error() {
$Walk = DB::queryWalk("SELECT * FROM accounts");
$Walk->next();
try {
// this will produce an out of sync error
DB::query("SELECT * FROM accounts");
} catch (MeekroDBException $e) {
if (substr_count($e->getMessage(), 'out of sync')) {
$exception_was_caught = 1;
}
}
$this->assert($exception_was_caught === 1);
}
} }