markTestSkipped( 'The GD extension is not available.' ); } } #[\PHPUnit\Framework\Attributes\Group('framework')] public function testImagePng() : void { $path = __DIR__ . '/c39.png'; if (\is_file($path)) { \unlink($path); } $img = new C39('ABCDEFG0123+-', 150, 50); $img->saveToPngFile($path); self::assertFileExists($path); } #[\PHPUnit\Framework\Attributes\Group('framework')] public function testImageJpg() : void { $path = __DIR__ . '/c39.jpg'; if (\is_file($path)) { \unlink($path); } $img = new C39('ABCDEFG0123+-', 150, 50); $img->saveToJpgFile($path); self::assertFileExists($path); } #[\PHPUnit\Framework\Attributes\Group('framework')] public function testOrientationAndMargin() : void { $path = __DIR__ . '/c39_vertical.png'; if (\is_file($path)) { \unlink($path); } $img = new C39('ABCDEFG0123+-', 50, 150, OrientationType::VERTICAL); $img->setMargin(2); $img->saveToPngFile($path); self::assertFileExists($path); } #[\PHPUnit\Framework\Attributes\Group('framework')] public function testValidString() : void { self::assertTrue(C39::isValidString('ABCDEFG0123+-')); self::assertFalse(C39::isValidString('ABC(DEFG0123+-')); } }