21use PHPUnit\Framework\Attributes\DataProvider;
27require_once
"Base.php";
36 yield [
'https://ilias.de/ilias',
'https://ilias.de/ilias'];
37 yield [
'https://ilias.de/ilias/',
'https://ilias.de/ilias'];
38 yield [
'http://ilias.de/ilias',
'http://ilias.de/ilias'];
39 yield [
'https://test9.ilias.de/goto.php',
'https://test9.ilias.de'];
40 yield [
'https://test9.ilias.de/goto.php/',
'https://test9.ilias.de'];
41 yield [
'https://test9.ilias.de/goto.php/wiki',
'https://test9.ilias.de'];
42 yield [
'https://test9.ilias.de/goto.php/wiki/22',
'https://test9.ilias.de'];
43 yield [
'http://test9.ilias.de/goto.php',
'http://test9.ilias.de'];
44 yield [
'http://test9.ilias.de/go/hello',
'http://test9.ilias.de'];
45 yield [
'http://test9.ilias.de/go/hello',
'http://test9.ilias.de'];
46 yield [
'http://test9.ilias.de/Customizing/plugins/Services/index.php',
'http://test9.ilias.de'];
49 #[DataProvider('getILIAS_HTTP_Paths')]
50 public function testBaseURI(
string $ILIAS_HTTP_PATH,
string $expected): void
55 $this->assertSame($expected, (
string) $uri_builder->getBaseURI());
60 yield [
'wiki', 42, [],
'https://test9.ilias.de/goto.php/wiki/42'];
61 yield [
'file', 42, [
'download'],
'https://test9.ilias.de/goto.php/file/42/download'];
62 yield [
'dashboard',
null, [],
'https://test9.ilias.de/goto.php/dashboard'];
65 #[DataProvider('getBuilderParts')]
69 $this->
getConfig(
'https://test9.ilias.de')
71 $uri = $uri_builder->build(
76 $this->assertSame($expected, (
string) $uri);
80 string $ILIAS_HTTP_PATH
84 private string $ILIAS_HTTP_PATH
88 public function get(
Config $config): mixed
90 return match ($config) {
91 Config::BASE_URL => $this->ILIAS_HTTP_PATH,
92 Config::REWRITE_POSSIBLE =>
false,
93 Config::SHORTLINK_NAMESPACE =>
'shortlink',
95 Config::ULTRA_SHORT =>
false,
static getILIAS_HTTP_Paths()
testBaseURI(string $ILIAS_HTTP_PATH, string $expected)
testFullBuilder(string $namespace, ?int $ref_id, array $params, string $expected)
getConfig(string $ILIAS_HTTP_PATH)
__construct()
Constructor setup ILIAS global object @access public.
return['delivery_method'=> 'php',]
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
if($err=$client->getError()) $namespace
A configuration for the setup.
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...