QRMatrixTest.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. /**
  3. * Class QRMatrixTest
  4. *
  5. * @filesource QRMatrixTest.php
  6. * @created 17.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\QRMatrix;
  14. use chillerlan\QRCodeTest\QRTestAbstract;
  15. class QRMatrixTest extends QRTestAbstract{
  16. protected $FQCN = QRMatrix::class;
  17. public function testInstance(){
  18. $q = $this->reflection->newInstanceArgs([1, 0]);
  19. $this->assertCount($q->size(), $q->matrix());
  20. $this->assertInstanceOf($this->FQCN, $q);
  21. }
  22. /**
  23. * @expectedException \chillerlan\QRCode\Data\QRCodeDataException
  24. * @expectedExceptionMessage invalid QR Code version
  25. */
  26. public function testInvalidVersionException(){
  27. $this->reflection->newInstanceArgs([42, 0]);
  28. }
  29. /**
  30. * @expectedException \chillerlan\QRCode\Data\QRCodeDataException
  31. * @expectedExceptionMessage invalid ecc level
  32. */
  33. public function testInvalidEccException(){
  34. $this->reflection->newInstanceArgs([1, 42]);
  35. }
  36. /* public function testSetFinderPattern(){
  37. $q = $this->reflection->newInstanceArgs([1, 0]);
  38. $q->setFinderPattern();
  39. var_dump($q->matrix());
  40. }*/
  41. }