MDL-87648 core: Allow routerconfigured in test CFG
This commit is contained in:
@@ -201,6 +201,7 @@ $allowed = ['wwwroot', 'dataroot', 'dirroot', 'admin', 'directorypermissions', '
|
||||
'proxyhost', 'proxyport', 'proxytype', 'proxyuser', 'proxypassword', 'proxybypass',
|
||||
'altcacheconfigpath', 'pathtogs', 'pathtophp', 'pathtodu', 'aspellpath', 'pathtodot',
|
||||
'pathtounoconv', 'alternative_file_system_class', 'pathtopython',
|
||||
'routerconfigured',
|
||||
];
|
||||
$productioncfg = (array) $CFG;
|
||||
$CFG = new stdClass();
|
||||
|
||||
@@ -93,12 +93,14 @@ final class router_test extends route_testcase {
|
||||
*/
|
||||
public function test_basepath(
|
||||
string $wwwroot,
|
||||
bool $configured,
|
||||
string $expected,
|
||||
): void {
|
||||
global $CFG;
|
||||
|
||||
$this->resetAfterTest();
|
||||
$CFG->wwwroot = $wwwroot;
|
||||
$CFG->routerconfigured = $configured;
|
||||
|
||||
$router = di::get(router::class);
|
||||
|
||||
@@ -106,8 +108,10 @@ final class router_test extends route_testcase {
|
||||
}
|
||||
|
||||
public static function basepath_provider(): \Iterator {
|
||||
yield 'Domain' => ['http://example.com', '/r.php'];
|
||||
yield 'Subdirectory' => ['http://example.com/moodle', '/moodle/r.php'];
|
||||
yield 'Domain Router not configured' => ['http://example.com', false, '/r.php'];
|
||||
yield 'Domain Router configured' => ['http://example.com', true, ''];
|
||||
yield 'Subdirectory Router not configured' => ['http://example.com/moodle', false, '/moodle/r.php'];
|
||||
yield 'Subdirectory Router configured' => ['http://example.com/moodle', true, '/moodle'];
|
||||
}
|
||||
|
||||
public function test_basepath_guessed_rphp(): void {
|
||||
|
||||
Reference in New Issue
Block a user