'description',
'content' => 'test tag',
]);
$this->assertEquals('', $tag);
}
public function testEmptyAttributes()
{
$tag = HTML::createTag('meta', [
'value' => 0,
'content' => '',
'max' => 3,
'details' => null,
'disabled' => false,
'readonly' => true,
]);
$this->assertEquals('', $tag);
}
public function testNormalTag()
{
$tag = HTML::createTag('a', [
'title' => 'Some link',
'nullattr' => null,
]);
$this->assertEquals('', $tag);
$tag = HTML::createTag('a', [
'title' => 'HTML & Text',
'nullattr' => null,
], 'Some content!');
$this->assertEquals('Some content!', $tag);
}
public function testImgTag()
{
$tag = HTML::createTag('img', [
'src' => 'example.png',
'alt' => '',
]);
$this->assertEquals('', $tag);
}
public function testVoidContentError()
{
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage("Void element \"link\" cannot have content");
HTML::createTag('link', [
'title' => 'HTML & Text',
'nullattr' => null,
], 'Some content!');
}
}