ILIAS  trunk Revision v11.0_alpha-1744-gb0451eebef4
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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.

References ILIAS\GlobalScreen\Provider\__construct(), and ILIAS\__construct().

Referenced by ILIAS\MetaData\Elements\Base\BaseSetTest\testClone(), ILIAS\MetaData\Elements\Base\BaseSetTest\testGetRoot(), and ILIAS\MetaData\Elements\Base\BaseSetTest\testNotRootException().

32  : BaseSet {
33  return new class ($root) extends BaseSet {
34  public function __construct(
35  BaseElementInterface $root
36  ) {
37  parent::__construct($root);
38  }
39  };
40  }
__construct()
Constructor setup ILIAS global object public.
Definition: class.ilias.php:76
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getRoot()

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

Definition at line 42 of file BaseSetTest.php.

Referenced by ILIAS\MetaData\Elements\Base\BaseSetTest\testClone(), and ILIAS\MetaData\Elements\Base\BaseSetTest\testGetRoot().

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  }
+ Here is the caller graph for this function:

◆ testClone()

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

Definition at line 73 of file BaseSetTest.php.

References ILIAS\MetaData\Elements\Base\BaseSetTest\getBaseSet(), and ILIAS\MetaData\Elements\Base\BaseSetTest\getRoot().

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
+ Here is the call graph for this function:

◆ testGetRoot()

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

Definition at line 57 of file BaseSetTest.php.

References ILIAS\MetaData\Elements\Base\BaseSetTest\getBaseSet(), and ILIAS\MetaData\Elements\Base\BaseSetTest\getRoot().

57  : void
58  {
59  $root = $this->getRoot();
60  $set = $this->getBaseSet($root);
61 
62  $this->assertSame($root, $set->getRoot());
63  }
getBaseSet(BaseElementInterface $root)
Definition: BaseSetTest.php:30
+ Here is the call graph for this function:

◆ testNotRootException()

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

Definition at line 65 of file BaseSetTest.php.

References ILIAS\MetaData\Elements\Base\BaseSetTest\getBaseSet().

65  : void
66  {
67  $not_root = new NullBaseElement();
68 
69  $this->expectException(\ilMDElementsException::class);
70  $set = $this->getBaseSet($not_root);
71  }
getBaseSet(BaseElementInterface $root)
Definition: BaseSetTest.php:30
+ Here is the call graph for this function:

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