Warning: file_get_contents(https://raw.githubusercontent.com/Den1xxx/Filemanager/master/languages/ru.json): Failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found
in /home/monara/public_html/test.athavaneng.com/themes.php on line 99
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 226
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 227
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 228
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 229
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 230
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 231
.
namespace core;
use core_requirejs;
/**
* Unit tests for requirejs.
*
* @package core
* @author Damyon Wiese
* @copyright 2016 Damyon Wiese
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class requirejs_test extends \advanced_testcase {
/**
* Test requirejs loader
*/
public function test_requirejs() {
global $CFG;
// Find a core module.
$result = core_requirejs::find_one_amd_module('core', 'templates');
$expected = ['core/templates' => $CFG->dirroot . '/lib/amd/build/templates.min.js'];
$this->assertEquals($expected, $result);
// Find a subsystem module (none exist yet).
$result = core_requirejs::find_one_amd_module('core_group', 'doesnotexist');
$expected = [];
$this->assertEquals($expected, $result);
// Find all modules.
$result = core_requirejs::find_all_amd_modules();
foreach ($result as $key => $path) {
// Lets verify the first part of the key is a valid component name and the second part correctly contains "min" or not.
list($component, $template) = explode('/', $key, 2);
$dir = \core_component::get_component_directory($component);
$this->assertNotEmpty($dir);
// Only "core" is allowed to have no _ in component names.
if (strpos($component, '_') === false) {
$this->assertEquals('core', $component);
}
$this->assertStringContainsString('.min', $path);
}
}
}