🚿 move and exclude test traits

This commit is contained in:
smiley
2025-11-01 21:28:10 +01:00
parent 53585226a5
commit 8237857cc3
18 changed files with 22 additions and 15 deletions
+1 -1
View File
@@ -14,7 +14,7 @@ namespace chillerlan\QRCodeBenchmark;
use chillerlan\QRCode\{QRCode, QROptions};
use chillerlan\QRCode\Common\{EccLevel, Mode, Version};
use chillerlan\QRCode\Data\QRMatrix;
use chillerlan\QRCodeTest\QRMaxLengthTrait;
use chillerlan\QRCodeTest\Traits\QRMaxLengthTrait;
use PhpBench\Attributes\{Iterations, ParamProviders, Revs, Warmup};
use Generator, RuntimeException;
use function extension_loaded, is_dir, mb_substr, mkdir, sprintf, str_repeat, str_replace;
+2 -1
View File
@@ -8,7 +8,8 @@
<testsuites>
<testsuite name="php-qrcode test suite">
<directory>tests</directory>
<exclude>tests/Performance</exclude>
<exclude>tests/samples</exclude>
<exclude>tests/Traits</exclude>
</testsuite>
</testsuites>
<source>
+1 -1
View File
@@ -14,7 +14,7 @@ namespace chillerlan\QRCodeTest\Data;
use chillerlan\QRCode\Common\{BitBuffer, EccLevel, MaskPattern, Mode, Version};
use chillerlan\QRCode\Data\{QRCodeDataException, QRData, QRDataModeInterface, QRMatrix};
use chillerlan\QRCode\QROptions;
use chillerlan\QRCodeTest\QRMaxLengthTrait;
use chillerlan\QRCodeTest\Traits\QRMaxLengthTrait;
use Exception, Generator;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\ExpectationFailedException;
+1 -1
View File
@@ -19,7 +19,7 @@ use chillerlan\QRCode\Data\QRData;
use chillerlan\QRCode\Output\QRGdImagePNG;
use chillerlan\QRCode\QRCode;
use chillerlan\QRCode\QROptions;
use chillerlan\QRCodeTest\QRMatrixDebugTrait;
use chillerlan\QRCodeTest\Traits\QRMatrixDebugTrait;
use PHPUnit\Framework\TestCase;
final class QRDataTest extends TestCase{
+1 -1
View File
@@ -14,7 +14,7 @@ namespace chillerlan\QRCodeTest\Data;
use chillerlan\QRCode\{QRCode, QROptions};
use chillerlan\QRCode\Common\{EccLevel, MaskPattern, Version};
use chillerlan\QRCode\Data\{QRCodeDataException, QRMatrix};
use chillerlan\QRCodeTest\QRMatrixDebugTrait;
use chillerlan\QRCodeTest\Traits\QRMatrixDebugTrait;
use PHPUnit\Framework\TestCase;
use PHPUnit\Framework\Attributes\DataProvider;
use Generator;
+1
View File
@@ -14,6 +14,7 @@ namespace chillerlan\QRCodeTest\Output;
use chillerlan\QRCode\QROptions;
use chillerlan\QRCode\Data\QRMatrix;
use chillerlan\QRCode\Output\{QRFpdf, QROutputInterface};
use chillerlan\QRCodeTest\Traits\RGBArrayModuleValueProviderTrait;
use chillerlan\Settings\SettingsContainerInterface;
use FPDF;
use function class_exists;
+1
View File
@@ -14,6 +14,7 @@ declare(strict_types=1);
namespace chillerlan\QRCodeTest\Output;
use chillerlan\QRCode\Data\QRMatrix;
use chillerlan\QRCodeTest\Traits\RGBArrayModuleValueProviderTrait;
use GdImage;
use function extension_loaded;
+1
View File
@@ -15,6 +15,7 @@ use chillerlan\QRCode\Data\QRMatrix;
use chillerlan\QRCode\Output\QRInterventionImage;
use chillerlan\QRCode\Output\QROutputInterface;
use chillerlan\QRCode\QROptions;
use chillerlan\QRCodeTest\Traits\CssColorModuleValueProviderTrait;
use chillerlan\Settings\SettingsContainerInterface;
use Intervention\Image\Interfaces\ImageInterface;
use function extension_loaded;
+1
View File
@@ -12,6 +12,7 @@ declare(strict_types=1);
namespace chillerlan\QRCodeTest\Output;
use chillerlan\QRCode\Data\QRMatrix;
use chillerlan\QRCodeTest\Traits\CssColorModuleValueProviderTrait;
/**
* Tests the QRMarkup output module
+1 -1
View File
@@ -11,7 +11,7 @@ declare(strict_types=1);
namespace chillerlan\QRCodeTest\Output;
use chillerlan\QRCodeTest\BuildDirTrait;
use chillerlan\QRCodeTest\Traits\BuildDirTrait;
use chillerlan\QRCode\{QRCode, QROptions};
use chillerlan\QRCode\Data\QRMatrix;
use chillerlan\QRCode\Output\{QRCodeOutputException, QROutputInterface};
+1
View File
@@ -14,6 +14,7 @@ namespace chillerlan\QRCodeTest\Output;
use chillerlan\QRCode\QROptions;
use chillerlan\QRCode\Data\QRMatrix;
use chillerlan\QRCode\Output\{QROutputInterface, QRStringJSON};
use chillerlan\QRCodeTest\Traits\CssColorModuleValueProviderTrait;
use chillerlan\Settings\SettingsContainerInterface;
final class QRStringJSONTest extends QROutputTestAbstract{
+2 -2
View File
@@ -18,11 +18,11 @@ use chillerlan\QRCode\{QRCode, QROptions};
use chillerlan\QRCode\Common\{EccLevel, LuminanceSourceInterface, Mode, Version};
use chillerlan\QRCode\Decoder\Decoder;
use chillerlan\QRCode\Output\QRGdImagePNG;
use chillerlan\QRCodeTest\Traits\{QRMatrixDebugTrait, QRMaxLengthTrait};
use chillerlan\Settings\SettingsContainerInterface;
use PHPUnit\Framework\Attributes\{DataProvider, Group};
use PHPUnit\Framework\TestCase;
use Exception, Generator;
use RuntimeException;
use Exception, Generator, RuntimeException;
use function array_map, defined, realpath, sprintf, str_repeat, substr;
/**
+1
View File
@@ -13,6 +13,7 @@ namespace chillerlan\QRCodeTest;
use chillerlan\QRCode\{QROptions, QRCode};
use chillerlan\QRCode\Output\QRCodeOutputException;
use chillerlan\QRCodeTest\Traits\BuildDirTrait;
use PHPUnit\Framework\TestCase;
use stdClass;
@@ -9,7 +9,7 @@
*/
declare(strict_types=1);
namespace chillerlan\QRCodeTest;
namespace chillerlan\QRCodeTest\Traits;
use RuntimeException;
use function dirname, file_exists, file_get_contents, is_file, mkdir, realpath, sprintf, trim;
@@ -19,13 +19,13 @@ use function dirname, file_exists, file_get_contents, is_file, mkdir, realpath,
*/
trait BuildDirTrait{
private string $_buildDir = __DIR__.'/../.build/';
protected const _buildDir = __DIR__.'/../../.build/';
/**
* returns the full raw path to the build dir
*/
protected function getBuildPath(string $subPath):string{
return $this->_buildDir.trim($subPath, '\\/');
return $this::_buildDir.trim($subPath, '\\/');
}
/**
@@ -9,7 +9,7 @@
*/
declare(strict_types=1);
namespace chillerlan\QRCodeTest\Output;
namespace chillerlan\QRCodeTest\Traits;
/**
* A data provider for use in tests that include CssColorModuleValueTrait
@@ -9,7 +9,7 @@
*/
declare(strict_types=1);
namespace chillerlan\QRCodeTest;
namespace chillerlan\QRCodeTest\Traits;
use chillerlan\QRCode\QROptions;
use chillerlan\QRCode\Data\QRMatrix;
@@ -9,7 +9,7 @@
*/
declare(strict_types=1);
namespace chillerlan\QRCodeTest;
namespace chillerlan\QRCodeTest\Traits;
use chillerlan\QRCode\Common\{EccLevel, Mode, Version};
use chillerlan\QRCode\QRCodeException;
@@ -9,7 +9,7 @@
*/
declare(strict_types=1);
namespace chillerlan\QRCodeTest\Output;
namespace chillerlan\QRCodeTest\Traits;
/**
* A data provider for use in tests that include RGBArrayModuleValueTrait