19declare(strict_types=1);
24use PHPUnit\Framework\Attributes\DataProvider;
25use PHPUnit\Framework\TestCase;
32 #[DataProvider('validNamespaces')]
37 $this->assertSame($value, $namespace->value());
38 $this->assertSame($value, (
string) $namespace);
47 'single segment' => [[
'ui'],
'ui'],
48 'two segments' => [[
'ui',
'storage'],
'ui.storage'],
49 'many segments' => [[
'my_component',
'view_state',
'table'],
'my_component.view_state.table'],
50 'uppercase' => [[
'Ui',
'Storage'],
'Ui.Storage'],
51 'leading digit' => [[
'1ui'],
'1ui'],
52 'hyphen' => [[
'ui-storage'],
'ui-storage'],
53 'backslash' => [[
'ILIAS\\UI'],
'ILIAS\\UI'],
62 #[DataProvider('invalidNamespaces')]
65 $this->expectException(\InvalidArgumentException::class);
77 'empty segment' => [[
'ui',
'']],
78 'dot in segment' => [[
'ui.storage']],
79 'colon in segment' => [[
'ui:storage']],
80 'control character' => [[
"ui\nstorage"]],
81 'non-string segment' => [[
'ui', 1]],
Isolates the keys of one consumer from every other consumer of a storage.
testInvalidNamespacesAreRejected(array $segments)
static invalidNamespaces()
testValidNamespacesAreAccepted(array $segments, string $value)