mirror of
https://github.com/chillerlan/php-qrcode.git
synced 2026-09-14 11:46:28 +00:00
:octocat: $returnResource coverage
This commit is contained in:
@@ -87,4 +87,11 @@ class QRFpdfTest extends QROutputTestAbstract{
|
||||
$this::assertSame($expected, $actual);
|
||||
}
|
||||
|
||||
public function testOutputGetResource():void{
|
||||
$this->options->returnResource = true;
|
||||
$this->outputInterface = $this->getOutputInterface($this->options);
|
||||
|
||||
$this::assertInstanceOf(FPDF::class, $this->outputInterface->dump());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -71,4 +71,19 @@ class QRImageTest extends QROutputTestAbstract{
|
||||
$this::assertTrue(true); // tricking the code coverage
|
||||
}
|
||||
|
||||
/**
|
||||
* @phan-suppress PhanUndeclaredClassReference
|
||||
*/
|
||||
public function testOutputGetResource():void{
|
||||
$this->options->returnResource = true;
|
||||
$this->outputInterface = $this->getOutputInterface($this->options);
|
||||
|
||||
$actual = $this->outputInterface->dump();
|
||||
|
||||
/** @noinspection PhpElementIsNotAvailableInCurrentPhpVersionInspection */
|
||||
\PHP_MAJOR_VERSION >= 8
|
||||
? $this::assertInstanceOf(\GdImage::class, $actual)
|
||||
: $this::assertIsResource($actual);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
|
||||
namespace chillerlan\QRCodeTest\Output;
|
||||
|
||||
use Imagick;
|
||||
use chillerlan\QRCode\{QRCode, QROptions};
|
||||
use chillerlan\QRCode\Output\{QROutputInterface, QRImagick};
|
||||
|
||||
@@ -69,4 +70,12 @@ class QRImagickTest extends QROutputTestAbstract{
|
||||
$this::assertTrue(true); // tricking the code coverage
|
||||
}
|
||||
|
||||
public function testOutputGetResource():void{
|
||||
$this->options->returnResource = true;
|
||||
$this->outputInterface = $this->getOutputInterface($this->options);
|
||||
|
||||
$this::assertInstanceOf(Imagick::class, $this->outputInterface->dump());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user