ILIAS  trunk Revision v12.0_alpha-377-g3641b37b9db
ILIAS\StaticURL\Tests\URIBuilderTest Class Reference
+ Inheritance diagram for ILIAS\StaticURL\Tests\URIBuilderTest:
+ Collaboration diagram for ILIAS\StaticURL\Tests\URIBuilderTest:

Public Member Functions

 testBaseURI (string $ILIAS_HTTP_PATH, string $expected)
 
 testFullBuilder (string $namespace, ?int $ref_id, array $params, string $expected)
 

Static Public Member Functions

static getILIAS_HTTP_Paths ()
 
static getBuilderParts ()
 

Private Member Functions

 getConfig (string $ILIAS_HTTP_PATH)
 

Detailed Description

Author
Fabian Schmid fabia.nosp@m.n@sr.nosp@m..solu.nosp@m.tion.nosp@m.s

Definition at line 32 of file URIBuilderTest.php.

Member Function Documentation

◆ getBuilderParts()

static ILIAS\StaticURL\Tests\URIBuilderTest::getBuilderParts ( )
static

Definition at line 58 of file URIBuilderTest.php.

58 : \Iterator
59 {
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'];
63 }

◆ getConfig()

ILIAS\StaticURL\Tests\URIBuilderTest::getConfig ( string  $ILIAS_HTTP_PATH)
private

Definition at line 79 of file URIBuilderTest.php.

81 : Configuration {
82 return new class ($ILIAS_HTTP_PATH) implements Configuration {
83 public function __construct(
84 private string $ILIAS_HTTP_PATH
85 ) {
86 }
87
88 public function get(Config $config): mixed
89 {
90 return match ($config) {
91 Config::BASE_URL => $this->ILIAS_HTTP_PATH,
92 Config::REWRITE_POSSIBLE => false,
93 Config::SHORTLINK_NAMESPACE => 'shortlink',
94 Config::STATIC_LINK_ENDPOINT => StandardURIBuilder::LONG,
95 Config::ULTRA_SHORT => false,
96 default => null,
97 };
98 }
99
100 };
101 }
__construct()
Constructor setup ILIAS global object @access public.
Definition: class.ilias.php:76

Referenced by ILIAS\StaticURL\Tests\URIBuilderTest\testBaseURI(), and ILIAS\StaticURL\Tests\URIBuilderTest\testFullBuilder().

+ Here is the caller graph for this function:

◆ getILIAS_HTTP_Paths()

static ILIAS\StaticURL\Tests\URIBuilderTest::getILIAS_HTTP_Paths ( )
static

Definition at line 34 of file URIBuilderTest.php.

34 : \Iterator
35 {
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'];
47 }

◆ testBaseURI()

ILIAS\StaticURL\Tests\URIBuilderTest::testBaseURI ( string  $ILIAS_HTTP_PATH,
string  $expected 
)

Definition at line 50 of file URIBuilderTest.php.

50 : void
51 {
52 $uri_builder = new StandardURIBuilder(
53 $this->getConfig($ILIAS_HTTP_PATH)
54 );
55 $this->assertSame($expected, (string) $uri_builder->getBaseURI());
56 }
getConfig(string $ILIAS_HTTP_PATH)

References ILIAS\StaticURL\Tests\URIBuilderTest\getConfig().

+ Here is the call graph for this function:

◆ testFullBuilder()

ILIAS\StaticURL\Tests\URIBuilderTest::testFullBuilder ( string  $namespace,
?int  $ref_id,
array  $params,
string  $expected 
)

Definition at line 66 of file URIBuilderTest.php.

66 : void
67 {
68 $uri_builder = new StandardURIBuilder(
69 $this->getConfig('https://test9.ilias.de')
70 );
71 $uri = $uri_builder->build(
73 $ref_id === null ? null : new ReferenceId($ref_id),
75 );
76 $this->assertSame($expected, (string) $uri);
77 }
if($err=$client->getError()) $namespace
$ref_id
Definition: ltiauth.php:66
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
Definition: ltiregstart.php:31

References $namespace, $params, $ref_id, and ILIAS\StaticURL\Tests\URIBuilderTest\getConfig().

+ Here is the call graph for this function:

The documentation for this class was generated from the following file: