:octocat: fix no.1 for #45

This commit is contained in:
codemasher
2020-04-11 08:59:28 +02:00
parent 29cb52756c
commit d13f3af5d2
5 changed files with 69 additions and 20 deletions
+16
View File
@@ -12,6 +12,7 @@
namespace chillerlan\QRCodeTest\Output;
use chillerlan\QRCodeExamples\MyCustomOutput;
use chillerlan\QRCode\{QRCode, QROptions};
use chillerlan\QRCode\Output\{QROutputInterface, QRString};
@@ -57,4 +58,19 @@ class QRStringTest extends QROutputTestAbstract{
$this::assertStringContainsString('B', $data);
}
/**
* covers the custom output functionality via an example
*/
public function testCustomOutput():void{
$this->options->version = 5;
$this->options->eccLevel = QRCode::ECC_L;
$this->options->outputType = QRCode::OUTPUT_CUSTOM;
$this->options->outputInterface = MyCustomOutput::class;
$this::assertSame(
file_get_contents(__DIR__.'/samples/custom'),
(new QRCode($this->options))->render('test')
);
}
}