Skip to content

Commit 8e1f430

Browse files
committed
:octocat: test reading vector images via Imagick convert
1 parent d1eacc1 commit 8e1f430

File tree

3 files changed

+2878
-1
lines changed

3 files changed

+2878
-1
lines changed

tests/QRCodeReaderImagickTest.php

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
namespace chillerlan\QRCodeTest;
1212

1313
use chillerlan\QRCode\Decoder\IMagickLuminanceSource;
14+
use chillerlan\QRCode\QRCode;
1415
use function extension_loaded;
1516

1617
/**
@@ -20,7 +21,6 @@ final class QRCodeReaderImagickTest extends QRCodeReaderTestAbstract{
2021

2122
protected string $FQN = IMagickLuminanceSource::class;
2223

23-
2424
protected function setUp():void{
2525

2626
if(!extension_loaded('imagick')){
@@ -32,4 +32,19 @@ protected function setUp():void{
3232
$this->options->readerUseImagickIfAvailable = true;
3333
}
3434

35+
public function vectorQRCodeProvider():array{
36+
return [
37+
'SVG' => ['vector_sample.svg', 'https://www.youtube.com/watch?v=dQw4w9WgXcQ', false],
38+
'EPS' => ['vector_sample.eps', 'https://www.youtube.com/watch?v=dQw4w9WgXcQ', false],
39+
];
40+
}
41+
42+
/**
43+
* @dataProvider vectorQRCodeProvider
44+
*/
45+
public function testReadVectorFormats(string $img, string $expected):void{
46+
$this::assertSame($expected, (string)(new QRCode)
47+
->readFromSource(IMagickLuminanceSource::fromFile(__DIR__.'/samples/'.$img, $this->options)));
48+
}
49+
3550
}

0 commit comments

Comments
 (0)