mirror of
https://github.com/chillerlan/php-qrcode.git
synced 2026-10-06 11:57:23 +00:00
:octocat: test reading vector images via Imagick convert
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
namespace chillerlan\QRCodeTest;
|
||||
|
||||
use chillerlan\QRCode\Decoder\IMagickLuminanceSource;
|
||||
use chillerlan\QRCode\QRCode;
|
||||
use function extension_loaded;
|
||||
|
||||
/**
|
||||
@@ -20,7 +21,6 @@ final class QRCodeReaderImagickTest extends QRCodeReaderTestAbstract{
|
||||
|
||||
protected string $FQN = IMagickLuminanceSource::class;
|
||||
|
||||
|
||||
protected function setUp():void{
|
||||
|
||||
if(!extension_loaded('imagick')){
|
||||
@@ -32,4 +32,19 @@ final class QRCodeReaderImagickTest extends QRCodeReaderTestAbstract{
|
||||
$this->options->readerUseImagickIfAvailable = true;
|
||||
}
|
||||
|
||||
public function vectorQRCodeProvider():array{
|
||||
return [
|
||||
'SVG' => ['vector_sample.svg', 'https://www.youtube.com/watch?v=dQw4w9WgXcQ', false],
|
||||
'EPS' => ['vector_sample.eps', 'https://www.youtube.com/watch?v=dQw4w9WgXcQ', false],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider vectorQRCodeProvider
|
||||
*/
|
||||
public function testReadVectorFormats(string $img, string $expected):void{
|
||||
$this::assertSame($expected, (string)(new QRCode)
|
||||
->readFromSource(IMagickLuminanceSource::fromFile(__DIR__.'/samples/'.$img, $this->options)));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user