Browse Source

:fire: v6.0 second pass: PHPUnit 10.4

smiley 2 years ago
parent
commit
2478f75324

+ 1 - 1
composer.json

@@ -47,7 +47,7 @@
 	"require-dev": {
 		"chillerlan/php-authenticator": "^5.0",
 		"phan/phan": "^5.4",
-		"phpunit/phpunit": "^9.6",
+		"phpunit/phpunit": "^10.4",
 		"phpmd/phpmd": "^2.14",
 		"setasign/fpdf": "^1.8.2",
 		"squizlabs/php_codesniffer": "^3.7"

+ 9 - 8
phpunit.xml.dist

@@ -1,21 +1,22 @@
 <?xml version="1.0"?>
 <phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-		 xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.6/phpunit.xsd"
-		 bootstrap="vendor/autoload.php"
-		 cacheResultFile=".build/phpunit.result.cache"
-		 colors="true"
-		 verbose="true"
+         xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.4/phpunit.xsd"
+         bootstrap="vendor/autoload.php"
+         cacheDirectory=".build/phpunit-cache"
+         colors="true"
 >
 	<testsuites>
 		<testsuite name="php-qrcode test suite">
-			<directory suffix=".php">./tests/</directory>
+			<directory>./tests/</directory>
 			<exclude>./tests/Performance</exclude>
 		</testsuite>
 	</testsuites>
-	<coverage processUncoveredFiles="true">
+	<source>
 		<include>
-			<directory suffix=".php">./src</directory>
+			<directory>src</directory>
 		</include>
+	</source>
+	<coverage>
 		<report>
 			<clover outputFile=".build/coverage/clover.xml"/>
 			<xml outputDirectory=".build/coverage/coverage-xml"/>

+ 2 - 3
tests/Common/BitBufferTest.php

@@ -12,6 +12,7 @@ namespace chillerlan\QRCodeTest\Common;
 
 use chillerlan\QRCode\Common\{BitBuffer, Mode};
 use chillerlan\QRCode\QRCodeException;
+use PHPUnit\Framework\Attributes\DataProvider;
 use PHPUnit\Framework\TestCase;
 
 /**
@@ -34,9 +35,7 @@ final class BitBufferTest extends TestCase{
 		];
 	}
 
-	/**
-	 * @dataProvider bitProvider
-	 */
+	#[DataProvider('bitProvider')]
 	public function testPut(int $data, int $value):void{
 		$this->bitBuffer->put($data, 4);
 		$this::assertSame($value, $this->bitBuffer->getBuffer()[0]);

+ 4 - 7
tests/Common/ECICharsetTest.php

@@ -12,6 +12,7 @@ namespace chillerlan\QRCodeTest\Common;
 
 use chillerlan\QRCode\Common\ECICharset;
 use chillerlan\QRCode\QRCodeException;
+use PHPUnit\Framework\Attributes\DataProvider;
 use PHPUnit\Framework\TestCase;
 
 final class ECICharsetTest extends TestCase{
@@ -20,9 +21,7 @@ final class ECICharsetTest extends TestCase{
 		return [[-1], [1000000]];
 	}
 
-	/**
-	 * @dataProvider invalidIdProvider
-	 */
+	#[DataProvider('invalidIdProvider')]
 	public function testInvalidDataException(int $id):void{
 		$this->expectException(QRCodeException::class);
 		$this->expectExceptionMessage('invalid charset id:');
@@ -30,7 +29,7 @@ final class ECICharsetTest extends TestCase{
 		new ECICharset($id);
 	}
 
-	public function encodingProvider():array{
+	public static function encodingProvider():array{
 		$params = [];
 
 		foreach(ECICharset::MB_ENCODINGS as $id => $name){
@@ -40,9 +39,7 @@ final class ECICharsetTest extends TestCase{
 		return $params;
 	}
 
-	/**
-	 * @dataProvider encodingProvider
-	 */
+	#[DataProvider('encodingProvider')]
 	public function testGetName(int $id, string $name = null):void{
 		$eciCharset = new ECICharset($id);
 

+ 2 - 2
tests/Common/MaskPatternTest.php

@@ -16,6 +16,7 @@ namespace chillerlan\QRCodeTest\Common;
 use chillerlan\QRCode\Common\MaskPattern;
 use chillerlan\QRCode\QRCodeException;
 use Closure;
+use PHPUnit\Framework\Attributes\DataProvider;
 use PHPUnit\Framework\TestCase;
 
 /**
@@ -95,9 +96,8 @@ final class MaskPatternTest extends TestCase{
 
 	/**
 	 * Tests if the mask function generates the correct pattern
-	 *
-	 * @dataProvider maskPatternProvider
 	 */
+	#[DataProvider('maskPatternProvider')]
 	public function testMask(int $pattern, array $expected):void{
 		$maskPattern = new MaskPattern($pattern);
 

+ 2 - 3
tests/Common/ModeTest.php

@@ -12,6 +12,7 @@ namespace chillerlan\QRCodeTest\Common;
 
 use chillerlan\QRCode\Common\Mode;
 use chillerlan\QRCode\QRCodeException;
+use PHPUnit\Framework\Attributes\DataProvider;
 use PHPUnit\Framework\TestCase;
 
 /**
@@ -33,9 +34,7 @@ final class ModeTest extends TestCase{
 		];
 	}
 
-	/**
-	 * @dataProvider versionProvider
-	 */
+	#[DataProvider('versionProvider')]
 	public function testGetLengthBitsForVersionBreakpoints(int $version, int $expected):void{
 		$this::assertSame($expected, Mode::getLengthBitsForVersion(Mode::NUMBER, $version));
 	}

+ 0 - 2
tests/Data/ByteTest.php

@@ -36,7 +36,6 @@ final class ByteTest extends DataInterfaceTestAbstract{
 	 * @inheritDoc
 	 */
 	public function testInvalidDataException():void{
-		/** @noinspection PhpUnitTestFailedLineInspection */
 		$this::markTestSkipped('N/A (binary mode)');
 	}
 
@@ -44,7 +43,6 @@ final class ByteTest extends DataInterfaceTestAbstract{
 	 * @inheritDoc
 	 */
 	public function testBinaryStringInvalid():void{
-		/** @noinspection PhpUnitTestFailedLineInspection */
 		$this::markTestSkipped('N/A (binary mode)');
 	}
 

+ 7 - 13
tests/Data/DataInterfaceTestAbstract.php

@@ -11,6 +11,7 @@
 namespace chillerlan\QRCodeTest\Data;
 
 use chillerlan\QRCode\Common\{EccLevel, MaskPattern, Mode, Version};
+use PHPUnit\Framework\Attributes\DataProvider;
 use chillerlan\QRCode\Data\{QRCodeDataException, QRData, QRDataModeInterface, QRMatrix};
 use chillerlan\QRCode\QROptions;
 use chillerlan\QRCodeTest\QRMaxLengthTrait;
@@ -64,9 +65,8 @@ abstract class DataInterfaceTestAbstract extends TestCase{
 
 	/**
 	 * Tests initializing the data matrix
-	 *
-	 * @dataProvider maskPatternProvider
 	 */
+	#[DataProvider('maskPatternProvider')]
 	public function testInitMatrix(int $pattern):void{
 		$maskPattern = new MaskPattern($pattern);
 
@@ -82,9 +82,8 @@ abstract class DataInterfaceTestAbstract extends TestCase{
 
 	/**
 	 * Tests if a string is properly validated for the respective data mode
-	 *
-	 * @dataProvider stringValidateProvider
 	 */
+	#[DataProvider('stringValidateProvider')]
 	public function testValidateString(string $string, bool $expected):void{
 		/** @noinspection PhpUndefinedMethodInspection */
 		$this::assertSame($expected, static::$FQN::validateString($string));
@@ -109,9 +108,8 @@ abstract class DataInterfaceTestAbstract extends TestCase{
 
 	/**
 	 * Tests decoding a data segment from a given BitBuffer
-	 *
-	 * @dataProvider versionBreakpointProvider
 	 */
+	#[DataProvider('versionBreakpointProvider')]
 	public function testDecodeSegment(int $version):void{
 		$options          = new QROptions;
 		$options->version = $version;
@@ -168,9 +166,7 @@ abstract class DataInterfaceTestAbstract extends TestCase{
 
 	}
 
-	/**
-	 * @dataProvider maxLengthProvider
-	 */
+	#[DataProvider('maxLengthProvider')]
 	public function testMaxLength(Version $version, EccLevel $eccLevel, string $str):void{
 		$options           = new QROptions;
 		$options->version  = $version->getVersionNumber();
@@ -185,9 +181,8 @@ abstract class DataInterfaceTestAbstract extends TestCase{
 
 	/**
 	 * Tests getting the minimum QR version for the given data
-	 *
-	 * @dataProvider maxLengthProvider
 	 */
+	#[DataProvider('maxLengthProvider')]
 	public function testGetMinimumVersion(Version $version, EccLevel $eccLevel, string $str):void{
 		$options           = new QROptions;
 		$options->version  = Version::AUTO;
@@ -208,9 +203,8 @@ abstract class DataInterfaceTestAbstract extends TestCase{
 
 	/**
 	 * Tests if an exception is thrown on data overflow
-	 *
-	 * @dataProvider maxLengthProvider
 	 */
+	#[DataProvider('maxLengthProvider')]
 	public function testMaxLengthOverflowException(Version $version, EccLevel $eccLevel, string $str, string $str1):void{
 		$this->expectException(QRCodeDataException::class);
 		$this->expectExceptionMessage('code length overflow');

+ 5 - 7
tests/Data/ECITest.php

@@ -13,6 +13,7 @@ namespace chillerlan\QRCodeTest\Data;
 use chillerlan\QRCode\QROptions;
 use chillerlan\QRCode\Common\{BitBuffer, ECICharset, Mode};
 use chillerlan\QRCode\Data\{Byte, ECI, Number, QRCodeDataException, QRData, QRDataModeInterface};
+use PHPUnit\Framework\Attributes\DataProvider;
 use PHPUnit\Framework\TestCase;
 
 /**
@@ -51,8 +52,8 @@ final class ECITest extends TestCase{
 
 	/**
 	 * @inheritDoc
-	 * @dataProvider versionBreakpointProvider
 	 */
+	#[DataProvider('versionBreakpointProvider')]
 	public function testDecodeSegment(int $version):void{
 		$options = new QROptions;
 		$options->version = $version;
@@ -102,9 +103,7 @@ final class ECITest extends TestCase{
 		];
 	}
 
-	/**
-	 * @dataProvider eciCharsetIdProvider
-	 */
+	#[DataProvider('eciCharsetIdProvider')]
 	public function testReadWrite(int $id, int $lengthInBits):void{
 		$bitBuffer = new BitBuffer;
 		$eci       = (new ECI($id))->write($bitBuffer, 1);
@@ -133,7 +132,7 @@ final class ECITest extends TestCase{
 		ECI::decodeSegment($bitBuffer, $options->version);
 	}
 
-	public function unknownEncodingDataProvider():array{
+	public static function unknownEncodingDataProvider():array{
 		return [
 			'CP437'              => [0, "\x41\x42\x43"],
 			'ISO_IEC_8859_1_GLI' => [1, "\x41\x42\x43"],
@@ -142,9 +141,8 @@ final class ECITest extends TestCase{
 
 	/**
 	 * Tests detection of an unknown character set
-	 *
-	 * @dataProvider unknownEncodingDataProvider
 	 */
+	#[DataProvider('unknownEncodingDataProvider')]
 	public function testConvertUnknownEncoding(int $id, string $data):void{
 		$options          = new QROptions;
 		$options->version = 5;

+ 4 - 4
tests/Data/HanziTest.php

@@ -12,6 +12,8 @@ namespace chillerlan\QRCodeTest\Data;
 
 use chillerlan\QRCode\Data\Hanzi;
 use Generator, Throwable;
+use PHPUnit\Framework\Attributes\DataProvider;
+use PHPUnit\Framework\Attributes\Group;
 use function bin2hex, chr, defined, sprintf;
 
 /**
@@ -57,10 +59,8 @@ final class HanziTest extends DataInterfaceTestAbstract{
 
 	}
 
-	/**
-	 * @group slow
-	 * @dataProvider hanziProvider
-	 */
+	#[Group('slow')]
+	#[DataProvider('hanziProvider')]
 	public function testValidateGB2312(string $chr):void{
 		// we may run into several issues due to encoding detection failures
 		try{

+ 4 - 4
tests/Data/KanjiTest.php

@@ -12,6 +12,8 @@ namespace chillerlan\QRCodeTest\Data;
 
 use chillerlan\QRCode\Data\Kanji;
 use Generator, Throwable;
+use PHPUnit\Framework\Attributes\DataProvider;
+use PHPUnit\Framework\Attributes\Group;
 use function bin2hex, chr, defined, sprintf;
 
 /**
@@ -76,10 +78,8 @@ final class KanjiTest extends DataInterfaceTestAbstract{
 
 	}
 
-	/**
-	 * @group slow
-	 * @dataProvider kanjiProvider
-	 */
+	#[Group('slow')]
+	#[DataProvider('kanjiProvider')]
 	public function testValidateSJIS(string $chr):void{
 		// we may run into several issues due to encoding detection failures
 		try{

+ 10 - 20
tests/Data/QRMatrixTest.php

@@ -10,6 +10,7 @@
 
 namespace chillerlan\QRCodeTest\Data;
 
+use PHPUnit\Framework\Attributes\DataProvider;
 use chillerlan\QRCode\{QRCode, QROptions};
 use chillerlan\QRCode\Common\{EccLevel, MaskPattern, Version};
 use chillerlan\QRCode\Data\{QRCodeDataException, QRMatrix};
@@ -176,9 +177,8 @@ final class QRMatrixTest extends TestCase{
 
 	/**
 	 * Tests setting the dark module and verifies its position
-	 *
-	 * @dataProvider matrixProvider
 	 */
+	#[DataProvider('matrixProvider')]
 	public function testSetDarkModule(QRMatrix $matrix):void{
 		$matrix->setDarkModule();
 
@@ -189,9 +189,8 @@ final class QRMatrixTest extends TestCase{
 
 	/**
 	 * Tests setting the finder patterns and verifies their positions
-	 *
-	 * @dataProvider matrixProvider
 	 */
+	#[DataProvider('matrixProvider')]
 	public function testSetFinderPattern(QRMatrix $matrix):void{
 		$matrix->setFinderPattern();
 
@@ -204,9 +203,8 @@ final class QRMatrixTest extends TestCase{
 
 	/**
 	 * Tests the separator patterns and verifies their positions
-	 *
-	 * @dataProvider matrixProvider
 	 */
+	#[DataProvider('matrixProvider')]
 	public function testSetSeparators(QRMatrix $matrix):void{
 		$matrix->setSeparators();
 
@@ -220,14 +218,12 @@ final class QRMatrixTest extends TestCase{
 
 	/**
 	 * Tests the alignment patterns and verifies their positions - version 1 (no pattern) skipped
-	 *
-	 * @dataProvider matrixProvider
 	 */
+	#[DataProvider('matrixProvider')]
 	public function testSetAlignmentPattern(QRMatrix $matrix):void{
 		$version = $matrix->getVersion();
 
 		if($version->getVersionNumber() === 1){
-			/** @noinspection PhpUnitTestFailedLineInspection */
 			$this::markTestSkipped('N/A (Version 1 has no alignment pattern)');
 		}
 
@@ -253,9 +249,8 @@ final class QRMatrixTest extends TestCase{
 
 	/**
 	 * Tests the timing patterns and verifies their positions
-	 *
-	 * @dataProvider matrixProvider
 	 */
+	#[DataProvider('matrixProvider')]
 	public function testSetTimingPattern(QRMatrix $matrix):void{
 
 		$matrix
@@ -282,13 +277,11 @@ final class QRMatrixTest extends TestCase{
 
 	/**
 	 * Tests the version patterns and verifies their positions - version < 7 skipped
-	 *
-	 * @dataProvider matrixProvider
 	 */
+	#[DataProvider('matrixProvider')]
 	public function testSetVersionNumber(QRMatrix $matrix):void{
 
 		if($matrix->getVersion()->getVersionNumber() < 7){
-			/** @noinspection PhpUnitTestFailedLineInspection */
 			$this::markTestSkipped('N/A (Version < 7)');
 		}
 
@@ -304,9 +297,8 @@ final class QRMatrixTest extends TestCase{
 
 	/**
 	 * Tests the format patterns and verifies their positions
-	 *
-	 * @dataProvider matrixProvider
 	 */
+	#[DataProvider('matrixProvider')]
 	public function testSetFormatInfo(QRMatrix $matrix):void{
 		$matrix->setFormatInfo(new MaskPattern(MaskPattern::PATTERN_000));
 
@@ -320,9 +312,8 @@ final class QRMatrixTest extends TestCase{
 
 	/**
 	 * Tests the quiet zone pattern and verifies its position
-	 *
-	 * @dataProvider matrixProvider
 	 */
+	#[DataProvider('matrixProvider')]
 	public function testSetQuietZone(QRMatrix $matrix):void{
 		$size          = $matrix->getSize();
 		$quietZoneSize = 5;
@@ -362,9 +353,8 @@ final class QRMatrixTest extends TestCase{
 
 	/**
 	 * Tests rotating the matrix by 90 degrees CW
-	 *
-	 * @dataProvider matrixProvider
 	 */
+	#[DataProvider('matrixProvider')]
 	public function testRotate90(QRMatrix $matrix):void{
 		$matrix->initFunctionalPatterns();
 

+ 4 - 10
tests/Output/QRGdImageTestAbstract.php

@@ -6,12 +6,14 @@
  * @author       Smiley <smiley@chillerlan.net>
  * @copyright    2017 Smiley
  * @license      MIT
+ *
+ * @noinspection PhpComposerExtensionStubsInspection
  */
 
 namespace chillerlan\QRCodeTest\Output;
 
 use chillerlan\QRCode\Data\QRMatrix;
-use const PHP_MAJOR_VERSION;
+use GdImage;
 
 /**
  * Tests the QRGdImage output module
@@ -58,19 +60,11 @@ abstract class QRGdImageTestAbstract extends QROutputTestAbstract{
 		$this::assertTrue(true); // tricking the code coverage
 	}
 
-	/**
-	 * @todo: remove php version check in v6
-	 */
 	public function testOutputGetResource():void{
 		$this->options->returnResource = true;
 		$this->outputInterface         = new $this->FQN($this->options, $this->matrix);
 
-		$actual = $this->outputInterface->dump();
-
-		/** @noinspection PhpFullyQualifiedNameUsageInspection */
-		PHP_MAJOR_VERSION >= 8
-			? $this::assertInstanceOf(\GdImage::class, $actual)
-			: $this::assertIsResource($actual);
+		$this::assertInstanceOf(GdImage::class, $this->outputInterface->dump());
 	}
 
 	public function testBase64MimeType():void{

+ 0 - 1
tests/Output/QRImagickTest.php

@@ -7,7 +7,6 @@
  * @copyright    2018 smiley
  * @license      MIT
  *
- * @noinspection PhpUndefinedClassInspection
  * @noinspection PhpComposerExtensionStubsInspection
  */
 

+ 12 - 16
tests/Output/QROutputTestAbstract.php

@@ -13,6 +13,8 @@ namespace chillerlan\QRCodeTest\Output;
 use chillerlan\QRCode\QRCode;
 use chillerlan\QRCode\QROptions;
 use chillerlan\QRCode\Data\QRMatrix;
+use chillerlan\Settings\SettingsContainerInterface;
+use PHPUnit\Framework\Attributes\DataProvider;
 use chillerlan\QRCode\Output\{QRCodeOutputException, QROutputInterface};
 use PHPUnit\Framework\TestCase;
 
@@ -25,12 +27,11 @@ use function str_replace;
  */
 abstract class QROutputTestAbstract extends TestCase{
 
-	/** @var \chillerlan\QRCode\QROptions|\chillerlan\Settings\SettingsContainerInterface */
-	protected QROptions         $options;
-	protected QROutputInterface $outputInterface;
-	protected QRMatrix          $matrix;
-	protected string            $builddir = __DIR__.'/../../.build/output_test';
-	protected string            $FQN;
+	protected SettingsContainerInterface|QROptions $options;
+	protected QROutputInterface                    $outputInterface;
+	protected QRMatrix                             $matrix;
+	protected string                               $builddir = __DIR__.'/../../.build/output-test';
+	protected string                               $FQN;
 
 	/**
 	 * Attempts to create a directory under /.build and instances several required objects
@@ -41,10 +42,10 @@ abstract class QROutputTestAbstract extends TestCase{
 			mkdir($this->builddir, 0777, true);
 		}
 
-		$this->options             = new QROptions;
+		$this->options                  = new QROptions;
 		$this->options->outputInterface = $this->FQN;
-		$this->matrix              = (new QRCode($this->options))->addByteSegment('testdata')->getQRMatrix();
-		$this->outputInterface     = new $this->FQN($this->options, $this->matrix);
+		$this->matrix                   = (new QRCode($this->options))->addByteSegment('testdata')->getQRMatrix();
+		$this->outputInterface          = new $this->FQN($this->options, $this->matrix);
 	}
 
 	/**
@@ -67,13 +68,8 @@ abstract class QROutputTestAbstract extends TestCase{
 
 	abstract public static function moduleValueProvider():array;
 
-	/**
-	 * @param mixed $value
-	 * @param bool  $expected
-	 *
-	 * @dataProvider moduleValueProvider
-	 */
-	public function testValidateModuleValues($value, bool $expected):void{
+	#[DataProvider('moduleValueProvider')]
+	public function testValidateModuleValues(mixed $value, bool $expected):void{
 		/** @noinspection PhpUndefinedMethodInspection */
 		$this::assertSame($expected, $this->FQN::moduleValueIsValid($value));
 	}

+ 7 - 2
tests/Output/QRStringJSONTest.php

@@ -11,6 +11,7 @@
 namespace chillerlan\QRCodeTest\Output;
 
 use chillerlan\QRCode\Output\QRStringJSON;
+use PHPUnit\Framework\Attributes\DataProvider;
 use function extension_loaded;
 
 /**
@@ -33,11 +34,15 @@ final class QRStringJSONTest extends QROutputTestAbstract{
 	}
 
 	public static function moduleValueProvider():array{
-		return [];
+		return [[null, false]];
+	}
+
+	#[DataProvider('moduleValueProvider')]
+	public function testValidateModuleValues(mixed $value, bool $expected):void{
+		$this::markTestSkipped('N/A (JSON test)');
 	}
 
 	public function testSetModuleValues():void{
-		/** @noinspection PhpUnitTestFailedLineInspection */
 		$this::markTestSkipped('N/A (JSON test)');
 	}
 

+ 2 - 3
tests/QRCodeReaderImagickTest.php

@@ -12,6 +12,7 @@ namespace chillerlan\QRCodeTest;
 
 use chillerlan\QRCode\Common\IMagickLuminanceSource;
 use chillerlan\QRCode\QRCode;
+use PHPUnit\Framework\Attributes\DataProvider;
 use function extension_loaded;
 use const PHP_OS_FAMILY, PHP_VERSION_ID;
 
@@ -43,9 +44,7 @@ final class QRCodeReaderImagickTest extends QRCodeReaderTestAbstract{
 		];
 	}
 
-	/**
-	 * @dataProvider vectorQRCodeProvider
-	 */
+	#[DataProvider('vectorQRCodeProvider')]
 	public function testReadVectorFormats(string $img, string $expected):void{
 
 		if(PHP_OS_FAMILY === 'Linux'){

+ 6 - 8
tests/QRCodeReaderTestAbstract.php

@@ -13,6 +13,8 @@
 namespace chillerlan\QRCodeTest;
 
 use chillerlan\QRCodeTest\Data\QRMatrixTest;
+use PHPUnit\Framework\Attributes\DataProvider;
+use PHPUnit\Framework\Attributes\Group;
 use chillerlan\QRCode\{QRCode, QROptions};
 use chillerlan\QRCode\Common\{EccLevel, Mode, Version};
 use chillerlan\QRCode\Output\QRGdImagePNG;
@@ -76,10 +78,8 @@ abstract class QRCodeReaderTestAbstract extends TestCase{
 		];
 	}
 
-	/**
-	 * @group slow
-	 * @dataProvider qrCodeProvider
-	 */
+	#[Group('slow')]
+	#[DataProvider('qrCodeProvider')]
 	public function testReader(string $img, string $expected, bool $grayscale):void{
 
 		if($grayscale){
@@ -140,10 +140,8 @@ abstract class QRCodeReaderTestAbstract extends TestCase{
 
 	}
 
-	/**
-	 * @group slow
-	 * @dataProvider dataTestProvider
-	 */
+	#[Group('slow')]
+	#[DataProvider('dataTestProvider')]
 	public function testReadData(Version $version, EccLevel $ecc, string $expected):void{
 		$this->options->outputInterface  = QRGdImagePNG::class;
 		$this->options->imageTransparent = false;

+ 1 - 1
tests/QRCodeTest.php

@@ -23,7 +23,7 @@ final class QRCodeTest extends TestCase{
 
 	private QRCode    $qrcode;
 	private QROptions $options;
-	private string    $builddir = __DIR__.'/../.build/output_test';
+	private string    $builddir = __DIR__.'/../.build/output-test';
 
 	/**
 	 * invoke test instances

+ 5 - 8
tests/QROptionsTest.php

@@ -16,6 +16,7 @@ use chillerlan\QRCode\Common\EccLevel;
 use chillerlan\QRCode\QRCodeException;
 use chillerlan\QRCode\QROptions;
 use chillerlan\QRCode\Common\Version;
+use PHPUnit\Framework\Attributes\DataProvider;
 use PHPUnit\Framework\TestCase;
 
 /**
@@ -37,9 +38,8 @@ final class QROptionsTest extends TestCase{
 
 	/**
 	 * Tests the $version clamping
-	 *
-	 * @dataProvider VersionProvider
 	 */
+	#[DataProvider('VersionProvider')]
 	public function testVersionClamp(int $version, int $expected):void{
 		$o = new QROptions(['version' => $version]);
 
@@ -60,9 +60,8 @@ final class QROptionsTest extends TestCase{
 
 	/**
 	 * Tests the $versionMin/$versionMax clamping
-	 *
-	 * @dataProvider VersionMinMaxProvider
 	 */
+	#[DataProvider('VersionMinMaxProvider')]
 	public function testVersionMinMaxClamp(int $versionMin, int $versionMax, int $expectedMin, int $expectedMax):void{
 		$o = new QROptions(['versionMin' => $versionMin, 'versionMax' => $versionMax]);
 
@@ -129,9 +128,8 @@ final class QROptionsTest extends TestCase{
 
 	/**
 	 * Tests the clamping (between 0 and 177) of the logo space values
-	 *
-	 * @dataProvider logoSpaceValueProvider
 	 */
+	#[DataProvider('logoSpaceValueProvider')]
 	public function testClampLogoSpaceValue(int $value, int $expected):void{
 		$o = new QROptions;
 
@@ -174,9 +172,8 @@ final class QROptionsTest extends TestCase{
 
 	/**
 	 * Tests clamping of the circle radius
-	 *
-	 * @dataProvider circleRadiusProvider
 	 */
+	#[DataProvider('circleRadiusProvider')]
 	public function testClampCircleRadius(float $value, float $expected):void{
 		$o = new QROptions(['circleRadius' => $value]);