19declare(strict_types=1);
24use PHPUnit\Framework\TestCase;
36 $component =
new class () implements
Component {
38 array|\ArrayAccess &$define,
39 array|\ArrayAccess &$implement,
40 array|\ArrayAccess &$use,
41 array|\ArrayAccess &$contribute,
42 array|\ArrayAccess &$seek,
43 array|\ArrayAccess &$provide,
44 array|\ArrayAccess &$pull,
45 array|\ArrayAccess &$internal,
53 $ilias_root = (string) realpath(__DIR__ .
'/../../../../../');
54 self::assertNotSame(
'',
$ilias_root,
'Could not resolve the ILIAS root from this test file - did it move?');
55 $expected_base_directory = str_replace(
$ilias_root .
'/',
'', __DIR__);
56 $expected_path = $expected_base_directory .
'/lang/';
58 $first_call = $directory->getPath();
59 $second_call = $directory->getPath();
60 $third_call = $directory->getPath();
62 self::assertSame($expected_path, $first_call);
63 self::assertSame($first_call, $second_call);
64 self::assertSame($first_call, $third_call);
69 $component =
new class () implements
Component {
71 array|\ArrayAccess &$define,
72 array|\ArrayAccess &$implement,
73 array|\ArrayAccess &$use,
74 array|\ArrayAccess &$contribute,
75 array|\ArrayAccess &$seek,
76 array|\ArrayAccess &$provide,
77 array|\ArrayAccess &$pull,
78 array|\ArrayAccess &$internal,
85 self::assertStringEndsWith(
'/custom/lang/path/', $directory->getPath());
90 return new class () implements
Component {
92 array|\ArrayAccess &$define,
93 array|\ArrayAccess &$implement,
94 array|\ArrayAccess &$use,
95 array|\ArrayAccess &$contribute,
96 array|\ArrayAccess &$seek,
97 array|\ArrayAccess &$provide,
98 array|\ArrayAccess &$pull,
99 array|\ArrayAccess &$internal,
109 self::assertSame(
'tos_%s', $directory->getShippedFileNamePattern());
116 self::assertSame(
'ilias_%s', $directory->getShippedFileNamePattern());
121 $this->expectException(\InvalidArgumentException::class);
Non-regression guard for the base directory getPath() caches: repeated calls on an unchanged object r...
testDefaultShippedFileNamePatternIsPrefixUnderscore()
testGetPathAppendsTheConfiguredPathInsideComponentToTheBaseDirectory()
testAnInvalidCustomShippedFileNamePatternIsRejectedByTheConstructor()
testACustomShippedFileNamePatternIsUsedAsGiven()
testGetPathReturnsTheSameValueOnRepeatedCallsAndMatchesTheUncachedComputation()
init(array|\ArrayAccess &$define, array|\ArrayAccess &$implement, array|\ArrayAccess &$use, array|\ArrayAccess &$contribute, array|\ArrayAccess &$seek, array|\ArrayAccess &$provide, array|\ArrayAccess &$pull, array|\ArrayAccess &$internal,)
$ilias_root
Lists every identifier of the shipped lang/ilias_*.lang files that occurs in one module in spellings ...