QRMatrixTest.php 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616
  1. <?php
  2. /**
  3. * Class QRMatrixTest
  4. *
  5. * @created 17.11.2017
  6. * @author Smiley <smiley@chillerlan.net>
  7. * @copyright 2017 Smiley
  8. * @license MIT
  9. */
  10. namespace chillerlan\QRCodeTest\Data;
  11. use chillerlan\QRCode\{QRCode, QROptions};
  12. use chillerlan\QRCode\Common\{EccLevel, MaskPattern, Version};
  13. use chillerlan\QRCode\Data\{QRCodeDataException, QRMatrix};
  14. use chillerlan\QRCode\Output\{QROutputInterface, QRString};
  15. use PHPUnit\Framework\TestCase;
  16. use Generator;
  17. use function defined;
  18. /**
  19. * Tests the QRMatrix class
  20. */
  21. final class QRMatrixTest extends TestCase{
  22. private const version = 40;
  23. private QRMatrix $matrix;
  24. /**
  25. * invokes a QRMatrix object
  26. */
  27. protected function setUp():void{
  28. $this->matrix = new QRMatrix(
  29. new Version($this::version),
  30. new EccLevel(EccLevel::L)
  31. );
  32. }
  33. /**
  34. * Matrix debugging console output
  35. */
  36. public static function debugMatrix(QRMatrix $matrix):void{
  37. /** @noinspection PhpUndefinedConstantInspection - see phpunit.xml.dist */
  38. if(defined('TEST_IS_CI') && TEST_IS_CI === true){
  39. return;
  40. }
  41. $opt = new QROptions;
  42. $opt->outputType = QROutputInterface::STRING_TEXT;
  43. $opt->eol = "\n";
  44. $opt->moduleValues = [
  45. // this is not ideal but it seems it's not possible anymore to colorize emoji via ansi codes
  46. // 🔴 🟠 🟡 🟢 🔵 🟣 ⚫️ ⚪️ 🟤
  47. // 🟥 🟧 🟨 🟩 🟦 🟪 ⬛ ⬜ 🟫
  48. // finder
  49. QRMatrix::M_FINDER_DARK => '🟥', // dark (true)
  50. QRMatrix::M_FINDER => '🔴', // light (false)
  51. QRMatrix::M_FINDER_DOT => '🟥', // finder dot, dark (true)
  52. // alignment
  53. QRMatrix::M_ALIGNMENT_DARK => '🟧',
  54. QRMatrix::M_ALIGNMENT => '🟠',
  55. // timing
  56. QRMatrix::M_TIMING_DARK => '🟨',
  57. QRMatrix::M_TIMING => '🟡',
  58. // format
  59. QRMatrix::M_FORMAT_DARK => '🟪',
  60. QRMatrix::M_FORMAT => '🟣',
  61. // version
  62. QRMatrix::M_VERSION_DARK => '🟩',
  63. QRMatrix::M_VERSION => '🟢',
  64. // data
  65. QRMatrix::M_DATA_DARK => '🟦',
  66. QRMatrix::M_DATA => '🔵',
  67. // dark module
  68. QRMatrix::M_DARKMODULE => '🟫',
  69. // separator
  70. QRMatrix::M_SEPARATOR => '⚪️',
  71. // quiet zone
  72. QRMatrix::M_QUIETZONE => '⬜',
  73. // logo space
  74. QRMatrix::M_LOGO => '⬜',
  75. // empty
  76. QRMatrix::M_NULL => '🟤',
  77. // data
  78. QRMatrix::M_TEST_DARK => '⬛',
  79. QRMatrix::M_TEST => '⚫️',
  80. ];
  81. $out = (new QRString($opt, $matrix))->dump();
  82. echo "\n\n".$out."\n\n";
  83. }
  84. /**
  85. * debugging shortcut - limit to a single version when using with matrixProvider
  86. *
  87. * @see QRMatrixTest::matrixProvider()
  88. */
  89. protected function dm(QRMatrix $matrix):void{
  90. // limit
  91. if($matrix->getVersion()->getVersionNumber() !== 7){
  92. return;
  93. }
  94. self::debugMatrix($matrix);
  95. }
  96. /**
  97. * Validates the QRMatrix instance
  98. */
  99. public function testInstance():void{
  100. $this::assertInstanceOf(QRMatrix::class, $this->matrix);
  101. }
  102. /**
  103. * Tests if size() returns the actual matrix size/count
  104. */
  105. public function testSize():void{
  106. $this::assertCount($this->matrix->getSize(), $this->matrix->getMatrix(true));
  107. }
  108. /**
  109. * Tests if version() returns the current (given) version
  110. */
  111. public function testVersion():void{
  112. $this::assertSame($this::version, $this->matrix->getVersion()->getVersionNumber());
  113. }
  114. /**
  115. * Tests if eccLevel() returns the current (given) ECC level
  116. */
  117. public function testECC():void{
  118. $this::assertSame(EccLevel::L, $this->matrix->getEccLevel()->getLevel());
  119. }
  120. /**
  121. * Tests if maskPattern() returns the current (or default) mask pattern
  122. */
  123. public function testMaskPattern():void{
  124. // set via matrix evaluation
  125. $matrix = (new QRCode)->addByteSegment('testdata')->getQRMatrix();
  126. $this::assertInstanceOf(MaskPattern::class, $matrix->getMaskPattern());
  127. $this::assertSame(MaskPattern::PATTERN_100, $matrix->getMaskPattern()->getPattern());
  128. }
  129. /**
  130. * Tests the set(), get() and check() methods
  131. */
  132. public function testGetSetCheck():void{
  133. $this->matrix->set(10, 10, true, QRMatrix::M_TEST);
  134. $this::assertSame(QRMatrix::M_TEST_DARK, $this->matrix->get(10, 10));
  135. $this::assertTrue($this->matrix->check(10, 10));
  136. $this->matrix->set(20, 20, false, QRMatrix::M_TEST);
  137. $this::assertSame(QRMatrix::M_TEST, $this->matrix->get(20, 20));
  138. $this::assertFalse($this->matrix->check(20, 20));
  139. // get proper results when using a *_DARK constant
  140. $this->matrix->set(30, 30, true, QRMatrix::M_TEST_DARK);
  141. $this::assertSame(QRMatrix::M_TEST_DARK, $this->matrix->get(30, 30));
  142. $this->matrix->set(40, 40, false, QRMatrix::M_TEST_DARK);
  143. $this::assertSame(QRMatrix::M_TEST, $this->matrix->get(40, 40));
  144. // out of range
  145. $this::assertFalse($this->matrix->check(-1, -1));
  146. $this::assertSame(-1, $this->matrix->get(-1, -1));
  147. }
  148. /**
  149. * Version data provider for several pattern tests
  150. */
  151. public static function matrixProvider():Generator{
  152. $ecc = new EccLevel(EccLevel::L);
  153. foreach(range(1, 40) as $i){
  154. yield 'version: '.$i => [new QRMatrix(new Version($i), $ecc)];
  155. }
  156. }
  157. /**
  158. * Tests setting the dark module and verifies its position
  159. *
  160. * @dataProvider matrixProvider
  161. */
  162. public function testSetDarkModule(QRMatrix $matrix):void{
  163. $matrix->setDarkModule();
  164. $this->dm($matrix);
  165. $this::assertSame(QRMatrix::M_DARKMODULE, $matrix->get(8, ($matrix->getSize() - 8)));
  166. }
  167. /**
  168. * Tests setting the finder patterns and verifies their positions
  169. *
  170. * @dataProvider matrixProvider
  171. */
  172. public function testSetFinderPattern(QRMatrix $matrix):void{
  173. $matrix->setFinderPattern();
  174. $this->dm($matrix);
  175. $this::assertSame(QRMatrix::M_FINDER_DARK, $matrix->get(0, 0));
  176. $this::assertSame(QRMatrix::M_FINDER_DARK, $matrix->get(0, ($matrix->getSize() - 1)));
  177. $this::assertSame(QRMatrix::M_FINDER_DARK, $matrix->get(($matrix->getSize() - 1), 0));
  178. }
  179. /**
  180. * Tests the separator patterns and verifies their positions
  181. *
  182. * @dataProvider matrixProvider
  183. */
  184. public function testSetSeparators(QRMatrix $matrix):void{
  185. $matrix->setSeparators();
  186. $this->dm($matrix);
  187. $this::assertSame(QRMatrix::M_SEPARATOR, $matrix->get(7, 0));
  188. $this::assertSame(QRMatrix::M_SEPARATOR, $matrix->get(0, 7));
  189. $this::assertSame(QRMatrix::M_SEPARATOR, $matrix->get(0, ($matrix->getSize() - 8)));
  190. $this::assertSame(QRMatrix::M_SEPARATOR, $matrix->get(($matrix->getSize() - 8), 0));
  191. }
  192. /**
  193. * Tests the alignment patterns and verifies their positions - version 1 (no pattern) skipped
  194. *
  195. * @dataProvider matrixProvider
  196. */
  197. public function testSetAlignmentPattern(QRMatrix $matrix):void{
  198. $version = $matrix->getVersion();
  199. if($version->getVersionNumber() === 1){
  200. /** @noinspection PhpUnitTestFailedLineInspection */
  201. $this::markTestSkipped('N/A (Version 1 has no alignment pattern)');
  202. }
  203. $matrix
  204. ->setFinderPattern()
  205. ->setAlignmentPattern()
  206. ;
  207. $this->dm($matrix);
  208. $alignmentPattern = $version->getAlignmentPattern();
  209. foreach($alignmentPattern as $py){
  210. foreach($alignmentPattern as $px){
  211. // skip finder pattern
  212. if(!$matrix->checkTypeIn($px, $py, [QRMatrix::M_FINDER, QRMatrix::M_FINDER_DOT])){
  213. $this::assertSame(QRMatrix::M_ALIGNMENT_DARK, $matrix->get($px, $py));
  214. }
  215. }
  216. }
  217. }
  218. /**
  219. * Tests the timing patterns and verifies their positions
  220. *
  221. * @dataProvider matrixProvider
  222. */
  223. public function testSetTimingPattern(QRMatrix $matrix):void{
  224. $matrix
  225. ->setFinderPattern()
  226. ->setAlignmentPattern()
  227. ->setTimingPattern()
  228. ;
  229. $this->dm($matrix);
  230. $size = $matrix->getSize();
  231. for($i = 7; $i < ($size - 7); $i++){
  232. if(($i % 2) === 0){
  233. // skip alignment pattern
  234. if(!$matrix->checkTypeIn(6, $i, [QRMatrix::M_ALIGNMENT])){
  235. $this::assertSame(QRMatrix::M_TIMING_DARK, $matrix->get(6, $i));
  236. $this::assertSame(QRMatrix::M_TIMING_DARK, $matrix->get($i, 6));
  237. }
  238. }
  239. }
  240. }
  241. /**
  242. * Tests the version patterns and verifies their positions - version < 7 skipped
  243. *
  244. * @dataProvider matrixProvider
  245. */
  246. public function testSetVersionNumber(QRMatrix $matrix):void{
  247. if($matrix->getVersion()->getVersionNumber() < 7){
  248. /** @noinspection PhpUnitTestFailedLineInspection */
  249. $this::markTestSkipped('N/A (Version < 7)');
  250. }
  251. $matrix->setVersionNumber();
  252. $this->dm($matrix);
  253. $this::assertTrue($matrix->checkType(($matrix->getSize() - 9), 0, QRMatrix::M_VERSION));
  254. $this::assertTrue($matrix->checkType(($matrix->getSize() - 11), 5, QRMatrix::M_VERSION));
  255. $this::assertTrue($matrix->checkType(0, ($matrix->getSize() - 9), QRMatrix::M_VERSION));
  256. $this::assertTrue($matrix->checkType(5, ($matrix->getSize() - 11), QRMatrix::M_VERSION));
  257. }
  258. /**
  259. * Tests the format patterns and verifies their positions
  260. *
  261. * @dataProvider matrixProvider
  262. */
  263. public function testSetFormatInfo(QRMatrix $matrix):void{
  264. $matrix->setFormatInfo(new MaskPattern(MaskPattern::PATTERN_000));
  265. $this->dm($matrix);
  266. $this::assertTrue($matrix->checkType(8, 0, QRMatrix::M_FORMAT));
  267. $this::assertTrue($matrix->checkType(0, 8, QRMatrix::M_FORMAT));
  268. $this::assertTrue($matrix->checkType(($matrix->getSize() - 1), 8, QRMatrix::M_FORMAT));
  269. $this::assertTrue($matrix->checkType(($matrix->getSize() - 8), 8, QRMatrix::M_FORMAT));
  270. }
  271. /**
  272. * Tests the quiet zone pattern and verifies its position
  273. *
  274. * @dataProvider matrixProvider
  275. */
  276. public function testSetQuietZone(QRMatrix $matrix):void{
  277. $size = $matrix->getSize();
  278. $quietZoneSize = 5;
  279. $matrix->set(0, 0, true, QRMatrix::M_TEST);
  280. $matrix->set(($size - 1), ($size - 1), true, QRMatrix::M_TEST);
  281. $matrix->setQuietZone($quietZoneSize);
  282. $s = ($size + 2 * $quietZoneSize);
  283. $this::assertCount($s, $matrix->getMatrix(true));
  284. $this::assertCount($s, $matrix->getMatrix(true)[($size - 1)]);
  285. $size = $matrix->getSize();
  286. $this->dm($matrix);
  287. $this::assertTrue($matrix->checkType(0, 0, QRMatrix::M_QUIETZONE));
  288. $this::assertTrue($matrix->checkType(($size - 1), ($size - 1), QRMatrix::M_QUIETZONE));
  289. $s = ($size - 1 - $quietZoneSize);
  290. $this::assertSame(QRMatrix::M_TEST_DARK, $matrix->get($quietZoneSize, $quietZoneSize));
  291. $this::assertSame(QRMatrix::M_TEST_DARK, $matrix->get($s, $s));
  292. }
  293. /**
  294. * Tests if an exception is thrown in an attempt to create the quiet zone before data was written
  295. */
  296. public function testSetQuietZoneException():void{
  297. $this->expectException(QRCodeDataException::class);
  298. $this->expectExceptionMessage('use only after writing data');
  299. $this->matrix->setQuietZone(42);
  300. }
  301. /**
  302. * Tests rotating the matrix by 90 degrees CW
  303. *
  304. * @dataProvider matrixProvider
  305. */
  306. public function testRotate90(QRMatrix $matrix):void{
  307. $matrix->initFunctionalPatterns();
  308. // matrix size
  309. $size = $matrix->getSize();
  310. // quiet zone size
  311. $qz = (($size - $matrix->getVersion()->getDimension()) / 2);
  312. // initial dark module position
  313. $this::assertSame(QRMatrix::M_DARKMODULE, $matrix->get((8 + $qz), ($size - 8 - $qz)));
  314. // first rotation
  315. $matrix->rotate90();
  316. $this->dm($matrix);
  317. $this::assertSame(QRMatrix::M_DARKMODULE, $matrix->get((7 + $qz), (8 + $qz)));
  318. // second rotation
  319. $matrix->rotate90();
  320. $this->dm($matrix);
  321. $this::assertSame(QRMatrix::M_DARKMODULE, $matrix->get(($size - 9 - $qz), (7 + $qz)));
  322. // third rotation
  323. $matrix->rotate90();
  324. $this->dm($matrix);
  325. $this::assertSame(QRMatrix::M_DARKMODULE, $matrix->get(($size - 8 - $qz), ($size - 9 - $qz)));
  326. // fourth rotation
  327. $matrix->rotate90();
  328. $this->dm($matrix);
  329. $this::assertSame(QRMatrix::M_DARKMODULE, $matrix->get((8 + $qz), ($size - 8 - $qz)));
  330. }
  331. /**
  332. * Tests if the logo space is drawn square if one of the dimensions is omitted
  333. */
  334. public function testSetLogoSpaceOmitHeight():void{
  335. $o = new QROptions;
  336. $o->version = 2;
  337. $o->eccLevel = EccLevel::H;
  338. $o->addQuietzone = false;
  339. $o->addLogoSpace = true;
  340. $o->logoSpaceHeight = 5;
  341. $matrix = (new QRCode($o))->addByteSegment('testdata')->getQRMatrix();
  342. self::debugMatrix($matrix);
  343. $this::assertFalse($matrix->checkType(9, 9, QRMatrix::M_LOGO));
  344. $this::assertTrue($matrix->checkType(10, 10, QRMatrix::M_LOGO));
  345. $this::assertTrue($matrix->checkType(14, 14, QRMatrix::M_LOGO));
  346. $this::assertFalse($matrix->checkType(15, 15, QRMatrix::M_LOGO));
  347. }
  348. /**
  349. * Tests the auto orientation of the logo space
  350. */
  351. public function testSetLogoSpaceOrientation():void{
  352. $o = new QROptions;
  353. $o->version = 10;
  354. $o->eccLevel = EccLevel::H;
  355. $o->addQuietzone = false;
  356. $matrix = (new QRCode($o))->addByteSegment('testdata')->getQRMatrix();
  357. // also testing size adjustment to uneven numbers
  358. $matrix->setLogoSpace(20, 14);
  359. self::debugMatrix($matrix);
  360. // NW corner
  361. $this::assertFalse($matrix->checkType(17, 20, QRMatrix::M_LOGO));
  362. $this::assertTrue($matrix->checkType(18, 21, QRMatrix::M_LOGO));
  363. // SE corner
  364. $this::assertTrue($matrix->checkType(38, 35, QRMatrix::M_LOGO));
  365. $this::assertFalse($matrix->checkType(39, 36, QRMatrix::M_LOGO));
  366. }
  367. /**
  368. * Tests the manual positioning of the logo space
  369. */
  370. public function testSetLogoSpacePosition():void{
  371. $o = new QROptions;
  372. $o->version = 10;
  373. $o->eccLevel = EccLevel::H;
  374. $o->addQuietzone = true;
  375. $o->quietzoneSize = 10;
  376. $matrix = (new QRCode($o))->addByteSegment('testdata')->getQRMatrix();
  377. self::debugMatrix($matrix);
  378. // logo space should not overwrite quiet zone & function patterns
  379. $matrix->setLogoSpace(21, 21, -10, -10);
  380. $this::assertSame(QRMatrix::M_QUIETZONE, $matrix->get(9, 9));
  381. $this::assertSame(QRMatrix::M_FINDER_DARK, $matrix->get(10, 10));
  382. $this::assertSame(QRMatrix::M_FINDER_DARK, $matrix->get(16, 16));
  383. $this::assertSame(QRMatrix::M_SEPARATOR, $matrix->get(17, 17));
  384. $this::assertSame(QRMatrix::M_FORMAT_DARK, $matrix->get(18, 18));
  385. $this::assertSame(QRMatrix::M_LOGO, $matrix->get(19, 19));
  386. $this::assertSame(QRMatrix::M_LOGO, $matrix->get(20, 20));
  387. $this::assertNotSame(QRMatrix::M_LOGO, $matrix->get(21, 21));
  388. // Ii just realized that setLogoSpace() could be called multiple times
  389. // on the same instance, and I'm not going to do anything about it :P
  390. $matrix->setLogoSpace(21, 21, 45, 45);
  391. $this::assertNotSame(QRMatrix::M_LOGO, $matrix->get(54, 54));
  392. $this::assertSame(QRMatrix::M_LOGO, $matrix->get(55, 55));
  393. $this::assertSame(QRMatrix::M_QUIETZONE, $matrix->get(67, 67));
  394. }
  395. /**
  396. * Tests whether an exception is thrown when an ECC level other than "H" is set when attempting to add logo space
  397. */
  398. public function testSetLogoSpaceInvalidEccException():void{
  399. $this->expectException(QRCodeDataException::class);
  400. $this->expectExceptionMessage('ECC level "H" required to add logo space');
  401. (new QRCode)->addByteSegment('testdata')->getQRMatrix()->setLogoSpace(50, 50);
  402. }
  403. /**
  404. * Tests whether an exception is thrown when width or height exceed the matrix size
  405. */
  406. public function testSetLogoSpaceExceedsException():void{
  407. $this->expectException(QRCodeDataException::class);
  408. $this->expectExceptionMessage('logo dimensions exceed matrix size');
  409. $o = new QROptions;
  410. $o->version = 5;
  411. $o->eccLevel = EccLevel::H;
  412. (new QRCode($o))->addByteSegment('testdata')->getQRMatrix()->setLogoSpace(69, 1);
  413. }
  414. /**
  415. * Tests whether an exception is thrown when the logo space size exceeds the maximum ECC capacity
  416. */
  417. public function testSetLogoSpaceMaxSizeException():void{
  418. $this->expectException(QRCodeDataException::class);
  419. $this->expectExceptionMessage('logo space exceeds the maximum error correction capacity');
  420. $o = new QROptions;
  421. $o->version = 5;
  422. $o->eccLevel = EccLevel::H;
  423. (new QRCode($o))->addByteSegment('testdata')->getQRMatrix()->setLogoSpace(37, 37);
  424. }
  425. /**
  426. * Tests checking whether the M_TYPE of a module is not one of an array of M_TYPES
  427. */
  428. public function testCheckTypeIn():void{
  429. $this->matrix->set(10, 10, true, QRMatrix::M_QUIETZONE);
  430. $this::assertFalse($this->matrix->checkTypeIn(10, 10, [QRMatrix::M_DATA, QRMatrix::M_FINDER]));
  431. $this::assertTrue($this->matrix->checkTypeIn(10, 10, [QRMatrix::M_QUIETZONE, QRMatrix::M_FINDER]));
  432. }
  433. /**
  434. * Tests checking the adjacent modules
  435. */
  436. public function testCheckNeighbours():void{
  437. $this->matrix
  438. ->setFinderPattern()
  439. ->setAlignmentPattern()
  440. ;
  441. /*
  442. * center of finder pattern (surrounded by all dark)
  443. *
  444. * # # # # # # #
  445. * # #
  446. * # # # # #
  447. * # # 0 # #
  448. * # # # # #
  449. * # #
  450. * # # # # # # #
  451. */
  452. $this::assertSame(0b11111111, $this->matrix->checkNeighbours(3, 3));
  453. /*
  454. * center of alignment pattern (surrounded by all light)
  455. *
  456. * # # # # #
  457. * # #
  458. * # 0 #
  459. * # #
  460. * # # # # #
  461. */
  462. $this::assertSame(0b00000000, $this->matrix->checkNeighbours(30, 30));
  463. /*
  464. * top left light block of finder pattern
  465. *
  466. * # # #
  467. * # 0
  468. * # #
  469. */
  470. $this::assertSame(0b11010111, $this->matrix->checkNeighbours(1, 1));
  471. /*
  472. * bottom left light block of finder pattern
  473. *
  474. * # #
  475. * # 0
  476. * # # #
  477. */
  478. $this::assertSame(0b11110101, $this->matrix->checkNeighbours(1, 5));
  479. /*
  480. * top right light block of finder pattern
  481. *
  482. * # # #
  483. * 0 #
  484. * # #
  485. */
  486. $this::assertSame(0b01011111, $this->matrix->checkNeighbours(5, 1));
  487. /*
  488. * bottom right light block of finder pattern
  489. *
  490. * # #
  491. * 0 #
  492. * # # #
  493. */
  494. $this::assertSame(0b01111101, $this->matrix->checkNeighbours(5, 5));
  495. /*
  496. * M_TYPE check
  497. *
  498. * # # #
  499. * 0
  500. * X X X
  501. */
  502. $this::assertSame(0b00000111, $this->matrix->checkNeighbours(3, 1, QRMatrix::M_FINDER));
  503. $this::assertSame(0b01110000, $this->matrix->checkNeighbours(3, 1, QRMatrix::M_FINDER_DOT));
  504. }
  505. }