2022-11-30 14:55:35 +00:00
|
|
|
<?php
|
|
|
|
|
2024-07-12 02:01:03 +00:00
|
|
|
namespace Joby\HTML\Nodes;
|
2022-11-30 14:55:35 +00:00
|
|
|
|
|
|
|
use PHPUnit\Framework\TestCase;
|
|
|
|
|
|
|
|
class CommentTest extends TestCase
|
|
|
|
{
|
|
|
|
public function testSimpleText(): void
|
|
|
|
{
|
|
|
|
$this->assertEquals('<!-- -->', new Comment(''));
|
|
|
|
$this->assertEquals('<!-- foo -->', new Comment('foo'));
|
|
|
|
$this->assertEquals('<!-- foo-bar -->', new Comment('foo-bar'));
|
|
|
|
$this->assertNotEquals('<!-- foo--bar -->', new Comment('foo--bar'));
|
|
|
|
}
|
2022-12-12 20:04:46 +00:00
|
|
|
|
|
|
|
public function testModification(): void
|
|
|
|
{
|
|
|
|
$comment = new Comment('foo');
|
|
|
|
$this->assertEquals('foo', $comment->value());
|
|
|
|
$comment->setValue('bar');
|
|
|
|
$this->assertEquals('bar', $comment->value());
|
|
|
|
}
|
2022-11-30 14:55:35 +00:00
|
|
|
}
|