Differences Between: [Versions 310 and 403] [Versions 311 and 403] [Versions 39 and 403] [Versions 400 and 403] [Versions 401 and 403]
1 <?php 2 // This file is part of Moodle - http://moodle.org/ 3 // 4 // Moodle is free software: you can redistribute it and/or modify 5 // it under the terms of the GNU General Public License as published by 6 // the Free Software Foundation, either version 3 of the License, or 7 // (at your option) any later version. 8 // 9 // Moodle is distributed in the hope that it will be useful, 10 // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 // GNU General Public License for more details. 13 // 14 // You should have received a copy of the GNU General Public License 15 // along with Moodle. If not, see <http://www.gnu.org/licenses/>. 16 17 namespace tool_log; 18 19 /** 20 * Log manager and log API tests. 21 * 22 * @package tool_log 23 * @copyright 2014 Petr Skoda {@link http://skodak.org/} 24 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 25 */ 26 class manager_test extends \advanced_testcase { 27 public function test_get_log_manager() { 28 global $CFG; 29 $this->resetAfterTest(); 30 31 $manager = get_log_manager(); 32 $this->assertInstanceOf('core\log\manager', $manager); 33 34 $stores = $manager->get_readers(); 35 $this->assertIsArray($stores); 36 $this->assertCount(0, $stores); 37 38 $this->assertFileExists("$CFG->dirroot/$CFG->admin/tool/log/store/standard/version.php"); 39 40 set_config('enabled_stores', 'logstore_standard', 'tool_log'); 41 $manager = get_log_manager(true); 42 $this->assertInstanceOf('core\log\manager', $manager); 43 44 $stores = $manager->get_readers(); 45 $this->assertIsArray($stores); 46 $this->assertCount(1, $stores); 47 foreach ($stores as $key => $store) { 48 $this->assertIsString($key); 49 $this->assertInstanceOf('core\log\sql_reader', $store); 50 } 51 52 $stores = $manager->get_readers('core\log\sql_internal_table_reader'); 53 $this->assertIsArray($stores); 54 $this->assertCount(1, $stores); 55 foreach ($stores as $key => $store) { 56 $this->assertIsString($key); 57 $this->assertSame('logstore_standard', $key); 58 $this->assertInstanceOf('core\log\sql_internal_table_reader', $store); 59 } 60 61 $stores = $manager->get_readers('core\log\sql_reader'); 62 $this->assertIsArray($stores); 63 $this->assertCount(1, $stores); 64 foreach ($stores as $key => $store) { 65 $this->assertIsString($key); 66 $this->assertInstanceOf('core\log\sql_reader', $store); 67 } 68 } 69 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body