Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 1441
Línea 26... Línea 26...
26
 * @package     core
26
 * @package     core
27
 * @covers      \core\plugininfo\block
27
 * @covers      \core\plugininfo\block
28
 * @copyright   2023 Andrew Lyons <andrew@nicols.co.uk>
28
 * @copyright   2023 Andrew Lyons <andrew@nicols.co.uk>
29
 * @license     http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
29
 * @license     http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
30
 */
30
 */
31
class block_test extends advanced_testcase {
31
final class block_test extends advanced_testcase {
Línea 32... Línea 32...
32
 
32
 
33
    /**
33
    /**
34
     * Test the get_enabled_plugins method.
-
 
35
     *
-
 
36
     * @covers ::get_enabled_plugins
34
     * Test the get_enabled_plugins method.
37
     */
35
     */
38
    public function test_get_enabled_plugins(): void {
36
    public function test_get_enabled_plugins(): void {
Línea 39... Línea 37...
39
        $this->resetAfterTest();
37
        $this->resetAfterTest();
Línea 68... Línea 66...
68
        $pluginmanager = \core_plugin_manager::instance();
66
        $pluginmanager = \core_plugin_manager::instance();
69
        $plugininfo = $pluginmanager->get_plugin_info("block_{$plugin}");
67
        $plugininfo = $pluginmanager->get_plugin_info("block_{$plugin}");
70
        $this->assertEquals($expected, $plugininfo->is_uninstall_allowed());
68
        $this->assertEquals($expected, $plugininfo->is_uninstall_allowed());
71
    }
69
    }
Línea 72... Línea 70...
72
 
70
 
73
    public function is_uninstall_allowed_provider(): array {
71
    public static function is_uninstall_allowed_provider(): array {
74
        $plugins = block::get_enabled_plugins();
72
        $plugins = block::get_enabled_plugins();
75
        return array_map(function ($plugin) {
73
        return array_map(function ($plugin) {
76
            $expected = true;
74
            $expected = true;
77
            if ($plugin === 'settings' || $plugin === 'navigation') {
75
            if ($plugin === 'settings' || $plugin === 'navigation') {