diff --git a/lib/dml/simpletest/testdml.php b/lib/dml/simpletest/testdml.php index d6298a847af..0d9d7a475c7 100644 --- a/lib/dml/simpletest/testdml.php +++ b/lib/dml/simpletest/testdml.php @@ -1267,6 +1267,7 @@ class dml_test extends UnitTestCase { } // test get_records passing non-existing table + // with params try { $records = $DB->get_records('xxxx', array('id' => 0)); $this->fail('An Exception is missing, expected due to query against non-existing table'); @@ -1274,6 +1275,14 @@ class dml_test extends UnitTestCase { $this->assertTrue($e instanceof dml_exception); $this->assertEqual($e->errorcode, 'ddltablenotexist'); } + // and without params + try { + $records = $DB->get_records('xxxx', array()); + $this->fail('An Exception is missing, expected due to query against non-existing table'); + } catch (exception $e) { + $this->assertTrue($e instanceof dml_exception); + $this->assertEqual($e->errorcode, 'ddltablenotexist'); + } // test get_records passing non-existing column try {