🛀 test overhaul

This commit is contained in:
smiley
2025-11-02 00:48:56 +01:00
parent b9d2059743
commit c99f5d4022
36 changed files with 356 additions and 333 deletions
+9 -16
View File
@@ -11,30 +11,21 @@ declare(strict_types=1);
namespace chillerlan\QRCodeTest\Output;
use chillerlan\QRCode\Data\QRMatrix;
use chillerlan\QRCode\Output\QRInterventionImage;
use chillerlan\QRCode\Output\QROutputInterface;
use chillerlan\QRCode\QROptions;
use chillerlan\QRCode\Data\QRMatrix;
use chillerlan\QRCode\Output\{QRInterventionImage, QROutputInterface};
use chillerlan\QRCodeTest\Traits\CssColorModuleValueProviderTrait;
use chillerlan\Settings\SettingsContainerInterface;
use Intervention\Image\Interfaces\ImageInterface;
use function extension_loaded;
use PHPUnit\Framework\Attributes\{RequiresPhpExtension, Test};
/**
* Tests the QRInterventionImage output module
* Tests the QRInterventionImage output class
*/
#[RequiresPhpExtension('gd')]
class QRInterventionImageTest extends QROutputTestAbstract{
use CssColorModuleValueProviderTrait;
protected function setUp():void{
if(!extension_loaded('gd')){
$this::markTestSkipped('ext-gd not loaded');
}
parent::setUp();
}
protected function getOutputInterface(
SettingsContainerInterface|QROptions $options,
QRMatrix $matrix,
@@ -42,7 +33,8 @@ class QRInterventionImageTest extends QROutputTestAbstract{
return new QRInterventionImage($options, $matrix);
}
public function testSetModuleValues():void{
#[Test]
public function setModuleValues():void{
$this->options->moduleValues = [
// data
@@ -57,7 +49,8 @@ class QRInterventionImageTest extends QROutputTestAbstract{
$this::assertTrue(true); // tricking the code coverage
}
public function testOutputGetResource():void{
#[Test]
public function outputGetResource():void{
$this->options->returnResource = true;
$this->outputInterface = $this->getOutputInterface($this->options, $this->matrix);