KanjiTest.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. /**
  3. * Class KanjiTest
  4. *
  5. * @filesource KanjiTest.php
  6. * @created 24.11.2017
  7. * @package chillerlan\QRCodeTest\Data
  8. * @author Smiley <smiley@chillerlan.net>
  9. * @copyright 2017 Smiley
  10. * @license MIT
  11. */
  12. namespace chillerlan\QRCodeTest\Data;
  13. use chillerlan\QRCode\Data\{Kanji, QRCodeDataException};
  14. class KanjiTest extends DatainterfaceTestAbstract{
  15. protected string $FQCN = Kanji::class;
  16. protected string $testdata = '茗荷茗荷茗荷茗荷茗荷';
  17. protected array $expected = [
  18. 128, 173, 85, 26, 95, 85, 70, 151,
  19. 213, 81, 165, 245, 84, 105, 125, 85,
  20. 26, 92, 0, 236, 17, 236, 17, 236,
  21. 17, 236, 17, 236, 17, 236, 17, 236,
  22. 17, 236, 17, 236, 17, 236, 17, 236,
  23. 17, 236, 17, 236, 17, 236, 17, 236,
  24. 17, 236, 17, 236, 17, 236, 17, 236,
  25. 17, 236, 17, 236, 17, 236, 17, 236,
  26. 17, 236, 17, 236, 17, 236, 17, 236,
  27. 17, 236, 17, 236, 17, 236, 17, 236,
  28. 195, 11, 221, 91, 141, 220, 163, 46,
  29. 165, 37, 163, 176, 79, 0, 64, 68,
  30. 96, 113, 54, 191
  31. ];
  32. public function testIllegalCharException1(){
  33. $this->expectException(QRCodeDataException::class);
  34. $this->expectExceptionMessage('illegal char at 1 [16191]');
  35. $this->dataInterface->setData('ÃÃ');
  36. }
  37. public function testIllegalCharException2(){
  38. $this->expectException(QRCodeDataException::class);
  39. $this->expectExceptionMessage('illegal char at 1');
  40. $this->dataInterface->setData('Ã');
  41. }
  42. }