. */ declare(strict_types=1); namespace Fisharebest\Webtrees\Tests\Encodings; use Fisharebest\Webtrees\Encodings\AbstractEncoding; use Fisharebest\Webtrees\Encodings\UTF8; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; use function chr; #[CoversClass(AbstractEncoding::class)] #[CoversClass(UTF8::class)] class UTF8Test extends TestCase { public function testToUtf8(): void { $encoding = new UTF8(); for ($i = 0; $i < 128; ++$i) { $char = chr($i); self::assertSame($char, $encoding->toUtf8($char)); } } public function testFromUtf8(): void { $encoding = new UTF8(); for ($i = 0; $i < 128; ++$i) { $char = chr($i); self::assertSame($char, $encoding->fromUtf8($char)); } } }