ILIAS  trunk Revision v11.0_alpha-1715-g7fc467680fb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
DictionaryInitiatorTest.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
35 
36 class DictionaryInitiatorTest extends TestCase
37 {
39  {
40  return new class () extends DictionaryInitiator {
41  public function __construct()
42  {
44  new NullFactory(),
46  new NullStructureSet()
47  );
48  }
49 
50  public function exposeAddTagToElement(
51  TagInterface $tag,
53  ): void {
54  parent::addTagToElement($tag, $element);
55  }
56 
57  public function exposeGetTagAssignments(): \Generator
58  {
59  yield from parent::getTagAssignments();
60  }
61  };
62  }
63 
64  public function testAddTagToElement(): void
65  {
66  $initiator = $this->getDictionaryInitiator();
67  $initiator->exposeAddTagToElement(
68  new NullTag(),
70  );
71  $initiator->exposeAddTagToElement(
72  new NullTag(),
74  );
75  $assignments = $initiator->exposeGetTagAssignments();
76 
77  $this->assertInstanceOf(
78  TagAssignmentInterface::class,
79  $assignments->current()
80  );
81  $assignments->next();
82  $this->assertInstanceOf(
83  TagAssignmentInterface::class,
84  $assignments->current()
85  );
86  $assignments->next();
87  $this->assertNull($assignments->current());
88  }
89 }
__construct()
Constructor setup ILIAS global object public.
Definition: class.ilias.php:76
__construct(Container $dic, ilPlugin $plugin)