mirror of
https://github.com/chillerlan/php-qrcode.git
synced 2026-10-08 12:55:59 +00:00
:octocat: fix no.1 for #45
This commit is contained in:
@@ -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')
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user