MDL-19057 fixed debug regression, going to refactor this into new methods soon

This commit is contained in:
Petr Skoda 2010-09-07 07:56:27 +00:00
parent d85a7d09a5
commit 8170809d52

View File

@ -1174,6 +1174,8 @@ class dml_test extends UnitTestCase {
}
public function test_get_record_sql() {
global $CFG;
$DB = $this->tdb;
$dbman = $DB->get_manager();
@ -1212,10 +1214,16 @@ class dml_test extends UnitTestCase {
}
// multiple matches - debug warning
$olddebug = $CFG->debug; // Save current debug settings
$olddisplay = $CFG->debugdisplay;
$CFG->debug = DEBUG_DEVELOPER;
$CFG->debugdisplay = true;
ob_start(); // hide debug warning
$this->assertTrue($DB->get_record_sql("SELECT * FROM {{$tablename}}", array(), IGNORE_MISSING));
$debuginfo = ob_get_contents();
ob_end_clean();
$CFG->debug = $olddebug; // Restore original debug settings
$CFG->debugdisplay = $olddisplay;
$this->assertFalse($debuginfo === '');
// multiple matches ignored