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