ILIAS
trunk Revision v11.0_alpha-2662-g519ff7d528f
◀ ilDoc Overview
FactoryTest.php
Go to the documentation of this file.
1
<?php
2
19
declare(strict_types=1);
20
21
namespace
ILIAS\MetaData\Elements
;
22
23
use
PHPUnit\Framework\TestCase
;
24
use
ILIAS\MetaData\Elements\Data\DataFactoryInterface
;
25
use
ILIAS\MetaData\Elements\Data\Type
;
26
use
ILIAS\MetaData\Elements\Data\DataInterface
;
27
use
ILIAS\MetaData\Structure\Definitions\DefinitionInterface
;
28
use
ILIAS\MetaData\Elements\RessourceID\RessourceIDInterface
;
29
use
ILIAS\MetaData\Structure\Definitions\NullDefinition
;
30
use
ILIAS\MetaData\Elements\Data\NullDataFactory
;
31
use
ILIAS\MetaData\Elements\RessourceID\NullRessourceID
;
32
33
class
FactoryTest
extends
TestCase
34
{
35
public
function
testCreateElement
(): void
36
{
37
$factory =
new
Factory
(
new
NullDataFactory
());
38
$el = $factory->element(13,
new
NullDefinition
(),
'value'
);
39
40
$this->assertInstanceOf(Element::class, $el);
41
$this->assertFalse($el->isRoot());
42
$this->assertFalse($el->isScaffold());
43
}
44
45
public
function
testCreateRoot
(): void
46
{
47
$factory =
new
Factory
(
new
NullDataFactory
());
48
$root = $factory->root(
new
NullDefinition
());
49
50
$this->assertInstanceOf(ElementInterface::class, $root);
51
$this->assertTrue($root->isRoot());
52
$this->assertFalse($root->isScaffold());
53
}
54
55
public
function
testCreateSet
(): void
56
{
57
$factory =
new
Factory
(
new
NullDataFactory
());
58
$root = $factory->root(
new
NullDefinition
());
59
$set = $factory->set(
new
NullRessourceID
(), $root);
60
61
$this->assertInstanceOf(SetInterface::class, $set);
62
}
63
}
ILIAS\MetaData\Elements\FactoryTest\testCreateSet
testCreateSet()
Definition:
FactoryTest.php:55
NullDataFactory
DataFactoryInterface
NullDefinition
ILIAS\MetaData\Elements\Data\NullDataFactory
Definition:
NullDataFactory.php:25
DataInterface
ILIAS\MetaData\Elements\FactoryTest\testCreateElement
testCreateElement()
Definition:
FactoryTest.php:35
ILIAS\MetaData\Structure\Definitions\NullDefinition
Definition:
NullDefinition.php:25
ILIAS\MetaData\Elements\FactoryTest\testCreateRoot
testCreateRoot()
Definition:
FactoryTest.php:45
RessourceIDInterface
ILIAS\MetaData\Elements\RessourceID\NullRessourceID
Definition:
NullRessourceID.php:23
ILIAS\MetaData\Elements\Data\Type
Type
Definition:
Type.php:23
ILIAS\MetaData\Elements
DefinitionInterface
ILIAS\MetaData\Elements\FactoryTest
Definition:
FactoryTest.php:33
ILIAS\MetaData\Elements\Factory
Definition:
Factory.php:30
NullRessourceID
TestCase
components
ILIAS
MetaData
tests
Elements
FactoryTest.php
Generated on Wed Sep 3 2025 23:02:50 for ILIAS by
1.8.13 (using
Doxyfile
)