Explorar el Código

:octocat: skip failing test under PHP-WIN < 8.1

smiley hace 2 años
padre
commit
97f16b017d
Se han modificado 1 ficheros con 5 adiciones y 3 borrados
  1. 5 3
      tests/QRCodeReaderImagickTest.php

+ 5 - 3
tests/QRCodeReaderImagickTest.php

@@ -13,7 +13,7 @@ namespace chillerlan\QRCodeTest;
 use chillerlan\QRCode\Decoder\IMagickLuminanceSource;
 use chillerlan\QRCode\QRCode;
 use function extension_loaded;
-use const PHP_OS_FAMILY;
+use const PHP_OS_FAMILY, PHP_VERSION_ID;
 
 /**
  * Tests the Imagick based reader
@@ -44,8 +44,6 @@ final class QRCodeReaderImagickTest extends QRCodeReaderTestAbstract{
 	}
 
 	/**
-	 * This test fails on Windows and PHP < 8.1 for whatever reason
-	 *
 	 * @dataProvider vectorQRCodeProvider
 	 */
 	public function testReadVectorFormats(string $img, string $expected):void{
@@ -54,6 +52,10 @@ final class QRCodeReaderImagickTest extends QRCodeReaderTestAbstract{
 			$this::markTestSkipped('avoid imagick conversion errors (ha ha)');
 		}
 
+		if(PHP_OS_FAMILY === 'Windows' && PHP_VERSION_ID < 80100){
+			$this::markTestSkipped('This test fails on Windows and PHP < 8.1 for whatever reason');
+		}
+
 		$this::assertSame($expected, (string)(new QRCode)
 			->readFromSource(IMagickLuminanceSource::fromFile(__DIR__.'/samples/'.$img, $this->options)));
 	}