mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 14:03:52 +01:00
MDL-42891 fix $interface parameter in dummy log manager and add unit tests
This commit is contained in:
parent
e083efe0ac
commit
43d91d7665
@ -50,5 +50,22 @@ class tool_log_manager_testcase extends advanced_testcase {
|
||||
$this->assertInternalType('string', $key);
|
||||
$this->assertInstanceOf('core\log\reader', $store);
|
||||
}
|
||||
|
||||
$stores = $manager->get_readers('core\log\sql_reader');
|
||||
$this->assertInternalType('array', $stores);
|
||||
$this->assertCount(1, $stores);
|
||||
foreach ($stores as $key => $store) {
|
||||
$this->assertInternalType('string', $key);
|
||||
$this->assertSame('logstore_standard', $key);
|
||||
$this->assertInstanceOf('core\log\sql_reader', $store);
|
||||
}
|
||||
|
||||
$stores = $manager->get_readers('core\log\reader');
|
||||
$this->assertInternalType('array', $stores);
|
||||
$this->assertCount(2, $stores);
|
||||
foreach ($stores as $key => $store) {
|
||||
$this->assertInternalType('string', $key);
|
||||
$this->assertInstanceOf('core\log\reader', $store);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ namespace core\log;
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
class dummy_manager implements manager {
|
||||
public function get_readers() {
|
||||
public function get_readers($interface = null) {
|
||||
return array();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user