:octocat: update multimode reader test to include hanzi mode

This commit is contained in:
smiley
2023-03-02 19:11:00 +01:00
parent cc58c403f8
commit e2c1ab0ad2
+5 -3
View File
@@ -89,25 +89,27 @@ abstract class QRCodeReaderTestAbstract extends TestCase{
$this::assertSame($expected, (string)$result);
}
public function testReaderMultiSegment():void{
public function testReaderMultiMode():void{
$this->options->outputType = QROutputInterface::GDIMAGE_PNG;
$this->options->imageBase64 = false;
$numeric = '123456789012345678901234567890';
$alphanum = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890 $%*+-./:';
$kanji = '茗荷茗荷茗荷茗荷';
$kanji = '漂う花の香り';
$hanzi = '无可奈何燃花作香';
$byte = 'https://smiley.codes/qrcode/';
$qrcode = (new QRCode($this->options))
->addNumericSegment($numeric)
->addAlphaNumSegment($alphanum)
->addKanjiSegment($kanji)
->addHanziSegment($hanzi)
->addByteSegment($byte)
;
$result = $qrcode->readFromBlob($qrcode->render());
$this::assertSame($numeric.$alphanum.$kanji.$byte, $result->data);
$this::assertSame($numeric.$alphanum.$kanji.$hanzi.$byte, $result->data);
}
public function dataTestProvider():Generator{