summaryrefslogtreecommitdiff
path: root/vendor/chillerlan/php-qrcode/tests/Data/KanjiTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/chillerlan/php-qrcode/tests/Data/KanjiTest.php')
-rw-r--r--vendor/chillerlan/php-qrcode/tests/Data/KanjiTest.php35
1 files changed, 28 insertions, 7 deletions
diff --git a/vendor/chillerlan/php-qrcode/tests/Data/KanjiTest.php b/vendor/chillerlan/php-qrcode/tests/Data/KanjiTest.php
index 108b8fed7..484f388dc 100644
--- a/vendor/chillerlan/php-qrcode/tests/Data/KanjiTest.php
+++ b/vendor/chillerlan/php-qrcode/tests/Data/KanjiTest.php
@@ -12,13 +12,19 @@
namespace chillerlan\QRCodeTest\Data;
-use chillerlan\QRCode\Data\{Kanji, QRCodeDataException};
+use chillerlan\QRCode\QROptions;
+use chillerlan\QRCode\Data\{Kanji, QRCodeDataException, QRDataInterface};
-class KanjiTest extends DatainterfaceTestAbstract{
+/**
+ * Tests the Kanji class
+ */
+final class KanjiTest extends DatainterfaceTestAbstract{
+
+ /** @internal */
+ protected string $testdata = '茗荷茗荷茗荷茗荷茗荷';
- protected $FQCN = Kanji::class;
- protected $testdata = '茗荷茗荷茗荷茗荷茗荷';
- protected $expected = [
+ /** @internal */
+ protected array $expected = [
128, 173, 85, 26, 95, 85, 70, 151,
213, 81, 165, 245, 84, 105, 125, 85,
26, 92, 0, 236, 17, 236, 17, 236,
@@ -34,17 +40,32 @@ class KanjiTest extends DatainterfaceTestAbstract{
96, 113, 54, 191
];
- public function testIllegalCharException1(){
+ /**
+ * @inheritDoc
+ * @internal
+ */
+ protected function getDataInterfaceInstance(QROptions $options):QRDataInterface{
+ return new Kanji($options);
+ }
+
+ /**
+ * Tests if an exception is thrown when an invalid character is encountered
+ */
+ public function testIllegalCharException1():void{
$this->expectException(QRCodeDataException::class);
$this->expectExceptionMessage('illegal char at 1 [16191]');
$this->dataInterface->setData('ÃÃ');
}
- public function testIllegalCharException2(){
+ /**
+ * Tests if an exception is thrown when an invalid character is encountered
+ */
+ public function testIllegalCharException2():void{
$this->expectException(QRCodeDataException::class);
$this->expectExceptionMessage('illegal char at 1');
$this->dataInterface->setData('Ã');
}
+
}