mirror of
https://github.com/chillerlan/php-qrcode.git
synced 2026-08-19 12:20:07 +00:00
🚿 move and exclude test traits
This commit is contained in:
@@ -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
@@ -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>
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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{
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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};
|
||||
|
||||
@@ -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{
|
||||
|
||||
@@ -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;
|
||||
|
||||
/**
|
||||
|
||||
@@ -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, '\\/');
|
||||
}
|
||||
|
||||
/**
|
||||
+1
-1
@@ -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;
|
||||
+1
-1
@@ -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
|
||||
Reference in New Issue
Block a user