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
.
/**
* Unit tests for tool_moodlenet lib
*
* @package tool_moodlenet
* @copyright 2020 Peter Dias
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace tool_moodlenet;
defined('MOODLE_INTERNAL') || die();
global $CFG;
require_once($CFG->dirroot . '/admin/tool/moodlenet/lib.php');
/**
* Test moodlenet functions
*/
class lib_test extends \advanced_testcase {
/**
* Test the generate_mnet_endpoint function
*
* @dataProvider get_endpoints_provider
* @param string $profileurl
* @param int $course
* @param int $section
* @param string $expected
*/
public function test_generate_mnet_endpoint($profileurl, $course, $section, $expected) {
$endpoint = generate_mnet_endpoint($profileurl, $course, $section);
$this->assertEquals($expected, $endpoint);
}
/**
* Dataprovider for test_generate_mnet_endpoint
*
* @return array
*/
public function get_endpoints_provider() {
global $CFG;
return [
[
'@name@domain.name',
1,
2,
'https://domain.name/' . MOODLENET_DEFAULT_ENDPOINT . '?site=' . urlencode($CFG->wwwroot)
. '&course=1§ion=2'
],
[
'@profile@name@domain.name',
1,
2,
'https://domain.name/' . MOODLENET_DEFAULT_ENDPOINT . '?site=' . urlencode($CFG->wwwroot)
. '&course=1§ion=2'
],
[
'https://domain.name',
1,
2,
'https://domain.name/' . MOODLENET_DEFAULT_ENDPOINT . '?site=' . urlencode($CFG->wwwroot)
. '&course=1§ion=2'
]
];
}
}