Issue#271: Fix refactored phpunit_util causing unit test error

substitute in platform-agnostic functions ->getDebuggingMessages and ->resetDebugging
This commit is contained in:
Sasha Anastasi
2021-12-22 14:25:44 +13:00
parent 690d90f3bc
commit 3181522f63
5 changed files with 16 additions and 16 deletions

View File

@@ -134,8 +134,8 @@ class auth_outage_calendar_test extends advanced_testcase {
]);
calendar::update($outage);
self::assertCount(1, phpunit_util::get_debugging_messages());
phpunit_util::reset_debugging();
self::assertCount(1, $this->getDebuggingMessages());
$this->resetDebugging();
}
/**
@@ -146,8 +146,8 @@ class auth_outage_calendar_test extends advanced_testcase {
self::setAdminUser();
calendar::delete(1);
self::assertCount(1, phpunit_util::get_debugging_messages());
phpunit_util::reset_debugging();
self::assertCount(1, $this->getDebuggingMessages());
$this->resetDebugging();
}
/**

View File

@@ -427,8 +427,8 @@ class auth_outage_outagedb_test extends auth_outage_base_testcase {
public function test_finish_now_notfound() {
$this->resetAfterTest(true);
outagedb::finish(1);
self::assertCount(1, phpunit_util::get_debugging_messages());
phpunit_util::reset_debugging();
self::assertCount(1, $this->getDebuggingMessages());
$this->resetDebugging();
}
/**
@@ -449,8 +449,8 @@ class auth_outage_outagedb_test extends auth_outage_base_testcase {
self::assertTrue(!$outage->is_ongoing($time));
outagedb::finish($id, $time);
self::assertCount(1, phpunit_util::get_debugging_messages());
phpunit_util::reset_debugging();
self::assertCount(1, $this->getDebuggingMessages());
$this->resetDebugging();
}
/**

View File

@@ -146,8 +146,8 @@ class auth_outage_forms_test extends auth_outage_base_testcase {
$_POST['description'] = ['text' => 'The <b>description</b>.', 'format' => '2'];
$edit = new edit();
self::assertNull($edit->get_data());
self::assertCount(1, phpunit_util::get_debugging_messages());
phpunit_util::reset_debugging();
self::assertCount(1, $this->getDebuggingMessages());
$this->resetDebugging();
}
/**

View File

@@ -401,8 +401,8 @@ class auth_outage_maintenance_static_page_test extends auth_outage_base_testcase
$found = maintenance_static_page_io::file_get_data(__DIR__.'/fixtures/invalidfile');
self::assertSame('', $found['contents']);
self::assertSame('unknown', $found['mime']);
self::assertCount(1, phpunit_util::get_debugging_messages());
phpunit_util::reset_debugging();
self::assertCount(1, $this->getDebuggingMessages());
$this->resetDebugging();
}
/**

View File

@@ -62,8 +62,8 @@ class auth_outage_outagelib_test extends auth_outage_base_testcase {
set_config('maintenance_message', 'A message.');
outagedb::save($outage);
self::assertFalse((bool)get_config('moodle', 'maintenance_message'));
self::assertCount(2, phpunit_util::get_debugging_messages());
phpunit_util::reset_debugging();
self::assertCount(2, $this->getDebuggingMessages());
$this->resetDebugging();
}
/**
@@ -116,8 +116,8 @@ class auth_outage_outagelib_test extends auth_outage_base_testcase {
$_GET = ['auth_outage_break_code' => '1'];
outagelib::reset_injectcalled();
$header = outagelib::get_inject_code();
self::assertCount(2, phpunit_util::get_debugging_messages());
phpunit_util::reset_debugging();
self::assertCount(2, $this->getDebuggingMessages());
$this->resetDebugging();
}
/**