19declare(strict_types=1);
23use PHPUnit\Framework\TestCase;
52 protected
int $path_id,
53 protected string $tag_name,
54 protected array $indices
60 return new class ($this->tag_name, $this->indices) extends
NullTag {
62 protected string $name,
63 protected array $indices
67 public function name()
72 public function indices(): \Generator
74 yield
from $this->indices;
77 public function isRestrictedToIndices(): bool
79 return !empty($this->indices);
84 public function path(): PathInterface
86 return new class ($this->path_id) extends NullPath {
93 return (
string) $this->path_id;
98 public function matchesPath(PathInterface
$path): bool
100 return (
string) $this->path_id ===
$path->toString();
108 $this->getTagAssignment(0,
'tag 0'),
109 $this->getTagAssignment(0,
'tag 0 index 0', 0),
110 $this->getTagAssignment(0,
'tag 0 index 3', 3),
111 $this->getTagAssignment(1,
'tag 1 index 1', 1),
112 $this->getTagAssignment(1,
'tag 1 index -2', -2),
113 $this->getTagAssignment(1,
'tag 1 index 0 and 1', 0, 1),
114 $this->getTagAssignment(1,
'tag 1 index -3 and 1', -3, 1),
115 $this->getTagAssignment(2,
'tag 2'),
116 $this->getTagAssignment(2,
'tag 2 number 2')
120 public function toElement(
122 bool $leads_to_exactly_one =
false
138 public function navigator(
149 if ($start_element->
getMDID() === 0) {
150 $this->start_element = $start_element;
156 public function elementsAtFinalStep(): \Generator
158 if ($this->path->toString() ===
'0') {
159 yield $this->start_element;
163 foreach ($this->start_element->getSubElements() as $sub) {
164 if ((
string) $sub->getMDID() === $this->path->toString()) {
173 return new class ($path_factory, $navigator_factory, ...$tag_assignments) extends
Dictionary {
175 PathFactoryInterface $path_factory,
192 protected array $subs
203 public function name(): string
210 public function getSubElements(): \Generator
212 yield
from $this->subs;
215 public function getSuperElement(): ?ElementInterface
220 public function setSuperElement(ElementInterface $super): void
222 $this->super = $super;
225 public function getMDID():
int|
NoID
234 $el2 = $this->getElement(2);
235 $el10 = $this->getElement(1);
236 $el11 = $this->getElement(1);
237 $el12 = $this->getElement(1);
238 $el3 = $this->getElement(3);
239 $el0 = $this->getElement(0, $el2, $el10, $el11, $el12, $el3);
241 $el2->setSuperElement($el0);
242 $el10->setSuperElement($el0);
243 $el11->setSuperElement($el0);
244 $el12->setSuperElement($el0);
245 $el3->setSuperElement($el0);
259 $dict = $this->getDictionary();
260 $tags = $dict->tagsForElement($this->getElements()[
'el2']);
264 $tags->current()->name()
269 $tags->current()->name()
272 $this->assertNull($tags->current());
274 $tags = $dict->tagsForElement($this->getElements()[
'el3']);
275 $this->assertNull($tags->current());
280 $dict = $this->getDictionary();
281 $els = $this->getElements();
282 $tags10 = $dict->tagsForElement($this->getElements()[
'el10']);
283 $tags11 = $dict->tagsForElement($this->getElements()[
'el11']);
284 $tags12 = $dict->tagsForElement($this->getElements()[
'el12']);
287 'tag 1 index 0 and 1',
288 $tags10->current()->name()
291 $this->assertNull($tags10->current());
295 $tags11->current()->name()
299 'tag 1 index 0 and 1',
300 $tags11->current()->name()
304 'tag 1 index -3 and 1',
305 $tags11->current()->name()
308 $this->assertNull($tags11->current());
310 $this->assertNull($tags12->current());
315 $dict = $this->getDictionary();
316 $tags = $dict->tagsForElement($this->getElements()[
'el0']);
320 $tags->current()->name()
325 $tags->current()->name()
328 $this->assertNull($tags->current());
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
__construct()
Constructor setup ILIAS global object @access public.
return['delivery_method'=> 'php',]
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc