MDL-42891 fix $interface parameter in dummy log manager and add unit tests

This commit is contained in:
Petr Škoda 2014-02-25 16:16:15 +08:00 committed by Petr Škoda
parent e083efe0ac
commit 43d91d7665
2 changed files with 18 additions and 1 deletions

View File

@ -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);
}
}
}

View File

@ -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();
}