html-object-strings/tests/Nodes/UnsanitizedTextTest.php

24 lines
628 B
PHP
Raw Normal View History

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 UnsanitizedTextTest extends TestCase
{
public function testSimpleText(): void
{
$this->assertEquals('', new UnsanitizedText(''));
$this->assertEquals('foo', new UnsanitizedText('foo'));
$this->assertEquals('<strong>foo</strong>', new UnsanitizedText('<strong>foo</strong>'));
}
2022-12-12 20:04:46 +00:00
public function testModification(): void
{
$text = new UnsanitizedText('foo');
$this->assertEquals('foo', $text->value());
$text->setValue('bar');
$this->assertEquals('bar', $text->value());
}
2022-11-30 14:55:35 +00:00
}