ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
TagTest.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
23use PHPUnit\Framework\TestCase;
24
25class TagTest extends TestCase
26{
27 protected function getTag(int ...$indices): Tag
28 {
29 return new class (...$indices) extends Tag {
30 public function __construct(int ...$indices)
31 {
32 parent::__construct(...$indices);
33 }
34 };
35 }
36
37 public function testIndices(): void
38 {
39 $indices = [12, 0, -3, 99999];
40 $tag = $this->getTag(...$indices);
41 $this->assertSame(
42 $indices,
43 iterator_to_array($tag->indices())
44 );
45 }
46
47 public function testIsRestrictedToIndices(): void
48 {
49 $tag_without_indices = $this->getTag();
50 $tag_with_indices = $this->getTag(6);
51
52 $this->assertFalse($tag_without_indices->isRestrictedToIndices());
53 $this->assertTrue($tag_with_indices->isRestrictedToIndices());
54 }
55}
__construct()
Constructor setup ILIAS global object @access public.
Definition: class.ilias.php:76
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc