18 declare(strict_types=1);
34 protected function setUp(): void
41 $null_tag = $this->factory->nullTag();
43 $this->assertInstanceOf(NullTag::class, $null_tag);
44 $this->assertEmpty($null_tag->toHtml());
49 $test_tag_1_html =
'test_tag_1_html';
52 $test_tag_2_html =
'test_tag_2_html';
55 $expected_html = $test_tag_1_html . PHP_EOL . $test_tag_2_html . PHP_EOL;
57 $tag_collection = $this->factory->collection([$test_tag_1, $test_tag_2]);
59 $this->assertCount(2, iterator_to_array($tag_collection->getTags()));
60 $this->assertEquals($expected_html, $tag_collection->toHtml());
65 $tag_collection = $this->factory->collection([]);
67 $this->assertEmpty(iterator_to_array($tag_collection->getTags()));
68 $this->assertEmpty($tag_collection->toHtml());
73 $test_tag_1_html =
'test_tag_1_html';
76 $test_tag_2_html =
'test_tag_2_html';
79 $test_tag_3_html =
'test_tag_3_html';
82 $expected_html = $test_tag_1_html . PHP_EOL . $test_tag_2_html . PHP_EOL . $test_tag_3_html . PHP_EOL;
84 $tag_collection = $this->factory->collection([
85 $this->factory->collection([$test_tag_1, $test_tag_2]),
89 $this->assertCount(3, iterator_to_array($tag_collection->getTags()));
90 $this->assertEquals($expected_html, $tag_collection->toHtml());
95 $key =
'expected_key';
96 $val =
'expected_value';
98 $user_defined_tag = $this->factory->userDefined(
$key, $val);
100 $this->assertInstanceOf(UserDefined::class, $user_defined_tag);
102 "<meta name=\"$key\" content=\"$val\" />",
103 $user_defined_tag->toHtml()
109 return new class ($html) extends
Tag {
111 protected string $html
115 public function toHtml():
string