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 parts of /lib/behat/lib.php.
*
* @package core
* @category test
* @copyright 2021 Université Rennes 2 {@link https://www.univ-rennes2.fr}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
/**
* Unit tests for parts of /lib/behat/lib.php.
*
* @package core
* @category test
* @copyright 2021 Université Rennes 2 {@link https://www.univ-rennes2.fr}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class behat_lib_test extends advanced_testcase {
/**
* Setup function
*
* Skip these tests if behat is not configured.
*
* @return void
*/
public function setUp(): void {
global $CFG;
if (empty($CFG->behat_wwwroot) || empty($CFG->behat_dataroot) || empty($CFG->behat_prefix)) {
$this->markTestSkipped('Behat not configured');
}
}
/**
* Tests for behat_is_requested_url() function.
*
* @dataProvider url_provider
* @covers ::behat_is_requested_url
*
* @param string $url URL used with behat_is_requested_url() function.
* @param bool $expectedvalue Expected value returned by behat_is_requested_url() function.
* @param array $environment Values to override $_SERVER global variable.
*/
public function test_behat_is_requested_url($url, $expectedvalue, $environment) {
// Save $_SERVER variable.
$server = $_SERVER;
// Setup $_SERVER variable for test.
list($_SERVER['HTTP_HOST'], $_SERVER['SERVER_PORT'], $_SERVER['SCRIPT_NAME']) = $environment;
// Test behat_is_requested_url() function.
$this->assertSame($expectedvalue, behat_is_requested_url($url));
// Restore $_SERVER variable.
$_SERVER = $server;
}
/**
* Data provider for test_behat_is_requested_url.
*
* @return array Array of values to test behat_is_requested_url() function.
*/
public function url_provider() {
return [
// Tests for common ports.
['http://behat.moodle.org', true, ['behat.moodle.org', 80, '']],
['https://behat.moodle.org', true, ['behat.moodle.org', 443, '']],
// Test for custom port.
['http://behat.moodle.org:8080', true, ['behat.moodle.org', 8080, '']],
// Test for url with path.
['http://behat.moodle.org/behat', true, ['behat.moodle.org', 80, '/behat']],
// Test for url that does not match with environment.
['http://behat.moodle.org', false, ['moodle.org', 80, '']],
];
}
}