ILIAS
trunk Revision v11.0_alpha-2658-ge2404539063
◀ ilDoc Overview
NameTest.php
Go to the documentation of this file.
1
<?php
2
19
declare(strict_types=1);
20
21
namespace
ILIAS\Component\Tests\Dependencies
;
22
23
use
PHPUnit\Framework\TestCase
;
24
use
ILIAS\Component\Dependencies\Name
;
25
26
class
NameTest
extends
TestCase
27
{
28
#[\PHPUnit\Framework\Attributes\DataProvider('properNames')]
29
public
function
testProperNames
(
string
$name): void
30
{
31
$n =
new
Name
($name);
32
$this->assertEquals($name, (
string
) $n);
33
}
34
35
#[\PHPUnit\Framework\Attributes\DataProvider('improperNames')]
36
public
function
testImproperNames
(
string
$name): void
37
{
38
$this->expectException(\InvalidArgumentException::class);
39
$n =
new
Name
($name);
40
}
41
42
public
static
function
properNames
(): array
43
{
44
return
[
45
[\ILIAS\Component\Tests::class],
46
[\Foo\Bar\Baz::class]
47
];
48
}
49
50
public
static
function
improperNames
(): array
51
{
52
return
[
53
[
'ILIAS \Component\Tests'
],
54
[\ILIAS\Component::class]
55
];
56
}
57
}
ILIAS\Component\Tests\Dependencies\NameTest\properNames
static properNames()
Definition:
NameTest.php:42
ILIAS\Component\Tests\Dependencies\NameTest\improperNames
static improperNames()
Definition:
NameTest.php:50
ILIAS\Component\Tests\Dependencies\NameTest
Definition:
NameTest.php:26
Name
ILIAS\Component\Tests\Dependencies
Definition:
NameTest.php:21
ILIAS\Component\Dependencies\Name
Definition:
Name.php:23
ILIAS\Component\Tests\Dependencies\NameTest\testProperNames
testProperNames(string $name)
Definition:
NameTest.php:29
ILIAS\Component\Tests\Dependencies\NameTest\testImproperNames
testImproperNames(string $name)
Definition:
NameTest.php:36
TestCase
components
ILIAS
Component
tests
Dependencies
NameTest.php
Generated on Tue Sep 2 2025 23:02:38 for ILIAS by
1.8.13 (using
Doxyfile
)