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

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