1919use chillerlan \Settings \SettingsContainerInterface ;
2020use PHPUnit \Framework \TestCase ;
2121use Exception , Generator ;
22- use function array_map , sprintf , str_repeat , substr ;
22+ use function array_map , defined , sprintf , str_repeat , substr ;
2323
2424/**
2525 * Tests the QR Code reader
@@ -40,6 +40,11 @@ abstract class QRCodeReaderTestAbstract extends TestCase{
4040 protected string $ FQN ;
4141
4242 protected function setUp ():void {
43+
44+ if (!defined ('READER_TEST_MAX_VERSION ' )){
45+ $ this ::markTestSkipped ('READER_TEST_MAX_VERSION not defined (see phpunit.xml.dist) ' );
46+ }
47+
4348 $ this ->options = new QROptions ;
4449 $ this ->options ->readerUseImagickIfAvailable = false ;
4550 }
@@ -117,7 +122,8 @@ public static function dataTestProvider():Generator{
117122 $ str = str_repeat (self ::loremipsum, 5 );
118123 $ eccLevels = array_map (fn (int $ ecc ):EccLevel => new EccLevel ($ ecc ), [EccLevel::L, EccLevel::M, EccLevel::Q, EccLevel::H]);
119124
120- for ($ v = 1 ; $ v <= 40 ; $ v ++){
125+ /** @noinspection PhpUndefinedConstantInspection - see phpunit.xml.dist */
126+ for ($ v = 1 ; $ v <= READER_TEST_MAX_VERSION ; $ v ++){
121127 $ version = new Version ($ v );
122128
123129 foreach ($ eccLevels as $ eccLevel ){
0 commit comments