diff --git a/tests/Common/BitBufferTest.php b/tests/Common/BitBufferTest.php index 3909a1c2b..b92ffa538 100644 --- a/tests/Common/BitBufferTest.php +++ b/tests/Common/BitBufferTest.php @@ -18,7 +18,7 @@ use PHPUnit\Framework\TestCase; */ final class BitBufferTest extends TestCase{ - protected BitBuffer $bitBuffer; + private BitBuffer $bitBuffer; protected function setUp():void{ $this->bitBuffer = new BitBuffer; diff --git a/tests/Data/QRMatrixTest.php b/tests/Data/QRMatrixTest.php index d86e21805..d458e86b2 100755 --- a/tests/Data/QRMatrixTest.php +++ b/tests/Data/QRMatrixTest.php @@ -21,8 +21,8 @@ use Generator; */ final class QRMatrixTest extends TestCase{ - protected const version = 40; - protected QRMatrix $matrix; + private const version = 40; + private QRMatrix $matrix; /** * invokes a QRMatrix object diff --git a/tests/Output/QRFpdfTest.php b/tests/Output/QRFpdfTest.php index 3159454fd..b0fbdba63 100644 --- a/tests/Output/QRFpdfTest.php +++ b/tests/Output/QRFpdfTest.php @@ -11,21 +11,21 @@ namespace chillerlan\QRCodeTest\Output; use FPDF; -use chillerlan\QRCode\Output\{QRFpdf, QROutputInterface}; use chillerlan\QRCode\{QRCode, QROptions}; +use chillerlan\QRCode\Data\QRMatrix; +use chillerlan\QRCode\Output\{QRFpdf, QROutputInterface}; use function class_exists, substr; /** * Tests the QRFpdf output module */ -class QRFpdfTest extends QROutputTestAbstract{ +final class QRFpdfTest extends QROutputTestAbstract{ /** * @inheritDoc - * @internal */ - public function setUp():void{ + protected function setUp():void{ if(!class_exists(FPDF::class)){ $this->markTestSkipped('FPDF not available'); @@ -36,7 +36,6 @@ class QRFpdfTest extends QROutputTestAbstract{ /** * @inheritDoc - * @internal */ protected function getOutputInterface(QROptions $options):QROutputInterface{ return new QRFpdf($options, $this->matrix); @@ -44,7 +43,6 @@ class QRFpdfTest extends QROutputTestAbstract{ /** * @inheritDoc - * @internal */ public function types():array{ return [ @@ -59,8 +57,8 @@ class QRFpdfTest extends QROutputTestAbstract{ $this->options->moduleValues = [ // data - 1024 => [0, 0, 0], - 4 => [255, 255, 255], + QRMatrix::M_DATA | QRMatrix::IS_DARK => [0, 0, 0], + QRMatrix::M_DATA => [255, 255, 255], ]; $this->outputInterface = $this->getOutputInterface($this->options); diff --git a/tests/Output/QRImageTest.php b/tests/Output/QRImageTest.php index e310b5f52..27e42702e 100644 --- a/tests/Output/QRImageTest.php +++ b/tests/Output/QRImageTest.php @@ -10,19 +10,20 @@ namespace chillerlan\QRCodeTest\Output; +use chillerlan\QRCode\Data\QRMatrix; use chillerlan\QRCode\{QRCode, QROptions}; use chillerlan\QRCode\Output\{QROutputInterface, QRImage}; +use const PHP_MAJOR_VERSION; /** * Tests the QRImage output module */ -class QRImageTest extends QROutputTestAbstract{ +final class QRImageTest extends QROutputTestAbstract{ /** * @inheritDoc - * @internal */ - public function setUp():void{ + protected function setUp():void{ if(!extension_loaded('gd')){ $this->markTestSkipped('ext-gd not loaded'); @@ -33,7 +34,6 @@ class QRImageTest extends QROutputTestAbstract{ /** * @inheritDoc - * @internal */ protected function getOutputInterface(QROptions $options):QROutputInterface{ return new QRImage($options, $this->matrix); @@ -41,7 +41,6 @@ class QRImageTest extends QROutputTestAbstract{ /** * @inheritDoc - * @internal */ public function types():array{ return [ @@ -58,8 +57,8 @@ class QRImageTest extends QROutputTestAbstract{ $this->options->moduleValues = [ // data - 1024 => [0, 0, 0], - 4 => [255, 255, 255], + QRMatrix::M_DATA | QRMatrix::IS_DARK => [0, 0, 0], + QRMatrix::M_DATA => [255, 255, 255], ]; $this->outputInterface = $this->getOutputInterface($this->options); @@ -78,7 +77,7 @@ class QRImageTest extends QROutputTestAbstract{ $actual = $this->outputInterface->dump(); /** @noinspection PhpFullyQualifiedNameUsageInspection */ - \PHP_MAJOR_VERSION >= 8 + PHP_MAJOR_VERSION >= 8 ? $this::assertInstanceOf(\GdImage::class, $actual) : $this::assertIsResource($actual); } diff --git a/tests/Output/QRImagickTest.php b/tests/Output/QRImagickTest.php index 9dc3a6c92..7c7431adc 100644 --- a/tests/Output/QRImagickTest.php +++ b/tests/Output/QRImagickTest.php @@ -14,19 +14,19 @@ namespace chillerlan\QRCodeTest\Output; use Imagick; +use chillerlan\QRCode\Data\QRMatrix; use chillerlan\QRCode\{QRCode, QROptions}; use chillerlan\QRCode\Output\{QROutputInterface, QRImagick}; /** * Tests the QRImagick output module */ -class QRImagickTest extends QROutputTestAbstract{ +final class QRImagickTest extends QROutputTestAbstract{ /** * @inheritDoc - * @internal */ - public function setUp():void{ + protected function setUp():void{ if(!extension_loaded('imagick')){ $this->markTestSkipped('ext-imagick not loaded'); @@ -37,7 +37,6 @@ class QRImagickTest extends QROutputTestAbstract{ /** * @inheritDoc - * @internal */ protected function getOutputInterface(QROptions $options):QROutputInterface{ return new QRImagick($options, $this->matrix); @@ -45,7 +44,6 @@ class QRImagickTest extends QROutputTestAbstract{ /** * @inheritDoc - * @internal */ public function types():array{ return [ @@ -60,8 +58,8 @@ class QRImagickTest extends QROutputTestAbstract{ $this->options->moduleValues = [ // data - 1024 => '#4A6000', - 4 => '#ECF9BE', + QRMatrix::M_DATA | QRMatrix::IS_DARK => '#4A6000', + QRMatrix::M_DATA => '#ECF9BE', ]; $this->outputInterface = $this->getOutputInterface($this->options); diff --git a/tests/Output/QRMarkupTest.php b/tests/Output/QRMarkupTest.php index 7c58249d4..87e63a925 100644 --- a/tests/Output/QRMarkupTest.php +++ b/tests/Output/QRMarkupTest.php @@ -10,17 +10,17 @@ namespace chillerlan\QRCodeTest\Output; -use chillerlan\QRCode\{Data\QRMatrix, QRCode, QROptions}; +use chillerlan\QRCode\{QRCode, QROptions}; +use chillerlan\QRCode\Data\QRMatrix; use chillerlan\QRCode\Output\{QROutputInterface, QRMarkup}; /** * Tests the QRMarkup output module */ -class QRMarkupTest extends QROutputTestAbstract{ +final class QRMarkupTest extends QROutputTestAbstract{ /** * @inheritDoc - * @internal */ protected function getOutputInterface(QROptions $options):QROutputInterface{ return new QRMarkup($options, $this->matrix); @@ -28,7 +28,6 @@ class QRMarkupTest extends QROutputTestAbstract{ /** * @inheritDoc - * @internal */ public function types():array{ return [ diff --git a/tests/Output/QROutputTestAbstract.php b/tests/Output/QROutputTestAbstract.php index f27c95261..0de9b1b32 100644 --- a/tests/Output/QROutputTestAbstract.php +++ b/tests/Output/QROutputTestAbstract.php @@ -26,19 +26,14 @@ use const PHP_OS_FAMILY, PHP_VERSION_ID; */ abstract class QROutputTestAbstract extends TestCase{ - /** @internal */ - protected string $builddir = __DIR__.'/../../.build/output_test'; - /** @internal */ + /** @var \chillerlan\QRCode\QROptions|\chillerlan\Settings\SettingsContainerInterface */ + protected QROptions $options; protected QROutputInterface $outputInterface; - /** @internal */ - protected QROptions $options; - /** @internal */ - protected QRMatrix $matrix; + protected QRMatrix $matrix; + protected string $builddir = __DIR__.'/../../.build/output_test'; /** * Attempts to create a directory under /.build and instances several required objects - * - * @internal */ protected function setUp():void{ @@ -54,8 +49,6 @@ abstract class QROutputTestAbstract extends TestCase{ /** * Returns a QROutputInterface instance with the given options and using $this->matrix - * - * @internal */ abstract protected function getOutputInterface(QROptions $options):QROutputInterface; @@ -90,7 +83,6 @@ abstract class QROutputTestAbstract extends TestCase{ /** * @see testStringOutput() * @return string[][] - * @internal */ abstract public function types():array; diff --git a/tests/Output/QRStringTest.php b/tests/Output/QRStringTest.php index d088ab27d..e525944b9 100644 --- a/tests/Output/QRStringTest.php +++ b/tests/Output/QRStringTest.php @@ -19,11 +19,10 @@ use chillerlan\QRCodeExamples\MyCustomOutput; /** * Tests the QRString output module */ -class QRStringTest extends QROutputTestAbstract{ +final class QRStringTest extends QROutputTestAbstract{ /** * @inheritDoc - * @internal */ protected function getOutputInterface(QROptions $options):QROutputInterface{ return new QRString($options, $this->matrix); @@ -31,7 +30,6 @@ class QRStringTest extends QROutputTestAbstract{ /** * @inheritDoc - * @internal */ public function types():array{ return [ diff --git a/tests/QRCodeReaderTest.php b/tests/QRCodeReaderTest.php index cab043436..26f4cbbed 100644 --- a/tests/QRCodeReaderTest.php +++ b/tests/QRCodeReaderTest.php @@ -23,7 +23,7 @@ use function extension_loaded, range, sprintf, str_repeat, substr; /** * Tests the QR Code reader */ -class QRCodeReaderTest extends TestCase{ +final class QRCodeReaderTest extends TestCase{ // https://www.bobrosslipsum.com/ protected const loremipsum = 'Just let this happen. We just let this flow right out of our minds. ' diff --git a/tests/QRCodeTest.php b/tests/QRCodeTest.php index 21e41f5d3..8db4f012d 100755 --- a/tests/QRCodeTest.php +++ b/tests/QRCodeTest.php @@ -18,17 +18,13 @@ use PHPUnit\Framework\TestCase; /** * Tests basic functions of the QRCode class */ -class QRCodeTest extends TestCase{ +final class QRCodeTest extends TestCase{ - /** @internal */ - protected QRCode $qrcode; - /** @internal */ - protected QROptions $options; + private QRCode $qrcode; + private QROptions $options; /** * invoke test instances - * - * @internal */ protected function setUp():void{ $this->qrcode = new QRCode; diff --git a/tests/QROptionsTest.php b/tests/QROptionsTest.php index d7513aa58..ed5eff5db 100644 --- a/tests/QROptionsTest.php +++ b/tests/QROptionsTest.php @@ -18,12 +18,10 @@ use PHPUnit\Framework\TestCase; /** * QROptions test */ -class QROptionsTest extends TestCase{ +final class QROptionsTest extends TestCase{ /** - * @see testVersionClamp() * @return int[][] - * @internal */ public function VersionProvider():array{ return [ @@ -46,9 +44,7 @@ class QROptionsTest extends TestCase{ } /** - * @see testVersionMinMaxClamp() * @return int[][] - * @internal */ public function VersionMinMaxProvider():array{ return [ @@ -72,9 +68,7 @@ class QROptionsTest extends TestCase{ } /** - * @see testMaskPatternClamp() * @return int[][] - * @internal */ public function MaskPatternProvider():array{ return [ @@ -106,9 +100,7 @@ class QROptionsTest extends TestCase{ } /** - * @see testClampRGBValues() * @return int[][][] - * @internal */ public function RGBProvider():array{ return [