ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ILIAS\MetaData\Elements\Base\BaseSetTest Class Reference
+ Inheritance diagram for ILIAS\MetaData\Elements\Base\BaseSetTest:
+ Collaboration diagram for ILIAS\MetaData\Elements\Base\BaseSetTest:

Public Member Functions

 testGetRoot ()
 
 testNotRootException ()
 
 testClone ()
 

Protected Member Functions

 getBaseSet (BaseElementInterface $root)
 
 getRoot ()
 

Detailed Description

Definition at line 28 of file BaseSetTest.php.

Member Function Documentation

◆ getBaseSet()

ILIAS\MetaData\Elements\Base\BaseSetTest::getBaseSet ( BaseElementInterface  $root)
protected

Definition at line 30 of file BaseSetTest.php.

32 : BaseSet {
33 return new class ($root) extends BaseSet {
34 public function __construct(
35 BaseElementInterface $root
36 ) {
38 }
39 };
40 }
__construct()
Constructor setup ILIAS global object @access public.
Definition: class.ilias.php:76
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References ILIAS\GlobalScreen\Provider\__construct().

+ Here is the call graph for this function:

◆ getRoot()

ILIAS\MetaData\Elements\Base\BaseSetTest::getRoot ( )
protected

Definition at line 42 of file BaseSetTest.php.

42 : BaseElementInterface
43 {
44 return new class () extends NullBaseElement {
45 public function getMDID(): int|NoID
46 {
47 return NoID::ROOT;
48 }
49
50 public function isRoot(): bool
51 {
52 return true;
53 }
54 };
55 }

◆ testClone()

ILIAS\MetaData\Elements\Base\BaseSetTest::testClone ( )

Definition at line 73 of file BaseSetTest.php.

73 : void
74 {
75 $root = $this->getRoot();
76 $set = $this->getBaseSet($root);
77
78 $cloned_set = clone $set;
79 $this->assertEquals($root, $cloned_set->getRoot());
80 $this->assertNotSame($root, $cloned_set->getRoot());
81 }
getBaseSet(BaseElementInterface $root)
Definition: BaseSetTest.php:30

◆ testGetRoot()

ILIAS\MetaData\Elements\Base\BaseSetTest::testGetRoot ( )

Definition at line 57 of file BaseSetTest.php.

57 : void
58 {
59 $root = $this->getRoot();
60 $set = $this->getBaseSet($root);
61
62 $this->assertSame($root, $set->getRoot());
63 }

◆ testNotRootException()

ILIAS\MetaData\Elements\Base\BaseSetTest::testNotRootException ( )

Definition at line 65 of file BaseSetTest.php.

65 : void
66 {
67 $not_root = new NullBaseElement();
68
69 $this->expectException(\ilMDElementsException::class);
70 $set = $this->getBaseSet($not_root);
71 }

The documentation for this class was generated from the following file: