ILIAS
trunk Revision v11.0_alpha-2662-g519ff7d528f
◀ ilDoc Overview
TagAssignmentTest.php
Go to the documentation of this file.
1
<?php
2
19
declare(strict_types=1);
20
21
namespace
ILIAS\MetaData\Structure\Dictionaries\Tags
;
22
23
use
PHPUnit\Framework\TestCase
;
24
use
ILIAS\MetaData\Paths\PathInterface
;
25
use
ILIAS\MetaData\Paths\NullPath
;
26
27
class
TagAssignmentTest
extends
TestCase
28
{
29
protected
function
getPath
(
string
$name):
PathInterface
30
{
31
return
new
class
($name) extends
NullPath
{
32
public
function
__construct
(
protected
string
$name)
33
{
34
}
35
36
public
function
toString
():
string
37
{
38
return
$this->name;
39
}
40
};
41
}
42
43
public
function
testTag
(): void
44
{
45
$tag =
new
NullTag
();
46
$assignment =
new
TagAssignment
($this->
getPath
(
'name'
), $tag);
47
48
$this->assertSame(
49
$tag,
50
$assignment->tag()
51
);
52
}
53
54
public
function
testMatchesPath
(): void
55
{
56
$first_path = $this->
getPath
(
'first path'
);
57
$second_path = $this->
getPath
(
'second path'
);
58
$assignment =
new
TagAssignment
($first_path,
new
NullTag
());
59
60
$this->assertTrue($assignment->matchesPath($first_path));
61
$this->assertFalse($assignment->matchesPath($second_path));
62
}
63
}
ILIAS\MetaData\Structure\Dictionaries\Tags\TagAssignmentTest\testTag
testTag()
Definition:
TagAssignmentTest.php:43
ILIAS\MetaData\Paths\NullPath
Definition:
NullPath.php:23
ILIAS\MetaData\Paths\PathInterface
Definition:
PathInterface.php:25
ILIAS\MetaData\Structure\Dictionaries\Tags\TagAssignment
Definition:
TagAssignment.php:25
ILIAS\__construct
__construct()
Constructor setup ILIAS global object public.
Definition:
class.ilias.php:76
ILIAS\MetaData\Structure\Dictionaries\Tags
Definition:
NullTag.php:21
ILIAS\MetaData\Structure\Dictionaries\Tags\TagAssignmentTest\getPath
getPath(string $name)
Definition:
TagAssignmentTest.php:29
ILIAS\Export\ImportHandler\File\XML\Manifest\toString
Definition:
ExportObjectType.php:30
ILIAS\MetaData\Structure\Dictionaries\Tags\TagAssignmentTest
Definition:
TagAssignmentTest.php:27
ILIAS\MetaData\Structure\Dictionaries\Tags\NullTag
Definition:
NullTag.php:23
PathInterface
NullPath
ILIAS\MetaData\Structure\Dictionaries\Tags\TagAssignmentTest\testMatchesPath
testMatchesPath()
Definition:
TagAssignmentTest.php:54
TestCase
components
ILIAS
MetaData
tests
Structure
Dictionaries
Tags
TagAssignmentTest.php
Generated on Wed Sep 3 2025 23:03:31 for ILIAS by
1.8.13 (using
Doxyfile
)