:octocat: $returnResource coverage

This commit is contained in:
codemasher
2020-11-18 01:24:44 +01:00
parent 65084283bc
commit d89693a27a
3 changed files with 31 additions and 0 deletions
+7
View File
@@ -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());
}
}
+15
View File
@@ -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);
}
}
+9
View File
@@ -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());
}
}