Skip to content

Commit

Permalink
MDL-35479 some more debugging assert cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
skodak committed Sep 17, 2012
1 parent 060bb94 commit a3b6e31
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 9 deletions.
3 changes: 1 addition & 2 deletions lib/ddl/tests/ddl_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -1542,10 +1542,9 @@ public function test_temp_tables() {
$this->assertTrue($dbman->table_exists('test_table1'));

// Make sure it can be dropped using deprecated drop_temp_table()
$CFG->debug = 0;
$dbman->drop_temp_table($table1);
$this->assertFalse($dbman->table_exists('test_table1'));
$CFG->debug = DEBUG_DEVELOPER;
$this->assertDebuggingCalled();
}

public function test_concurrent_temp_tables() {
Expand Down
6 changes: 2 additions & 4 deletions lib/tests/accesslib_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -1696,9 +1696,8 @@ public function test_permission_evaluation() {

// ====== $context->get_child_contexts() ================================

$CFG->debug = 0;
$children = $systemcontext->get_child_contexts();
$CFG->debug = DEBUG_DEVELOPER;
$this->resetDebugging();
$this->assertEquals(count($children)+1, $DB->count_records('context'));

$context = context_coursecat::instance($testcategories[3]);
Expand Down Expand Up @@ -2281,9 +2280,8 @@ public function test_permission_evaluation() {
}
}

$CFG->debug = 0;
$children = get_child_contexts($systemcontext);
$CFG->debug = DEBUG_DEVELOPER;
$this->resetDebugging();
$this->assertEquals(count($children), $DB->count_records('context')-1);
unset($children);

Expand Down
4 changes: 2 additions & 2 deletions lib/tests/moodlelib_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -1882,8 +1882,6 @@ public function test_delete_user() {
$this->assertTrue(true);
}

$CFG->debug = DEBUG_MINIMAL; // Prevent standard debug warnings.

$record = new stdClass();
$record->id = 666;
$record->username = 'xx';
Expand All @@ -1896,5 +1894,7 @@ public function test_delete_user() {

$result = delete_user($admin);
$this->assertFalse($result);

$this->resetDebugging();
}
}
1 change: 0 additions & 1 deletion lib/tests/textlib_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,6 @@ public function test_strtotitle() {
* @return void
*/
public function test_deprecated_textlib_get_instance() {
ob_start();
$textlib = textlib_get_instance();
$this->assertDebuggingCalled();
$this->assertSame($textlib->substr('abc', 1, 1), 'b');
Expand Down

0 comments on commit a3b6e31

Please sign in to comment.