Skip to content

Commit 911de7a

Browse files
committed
:octocat: removed QRMatrix::M_TEST
1 parent 171f0d9 commit 911de7a

File tree

3 files changed

+17
-28
lines changed

3 files changed

+17
-28
lines changed

src/Data/QRMatrix.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,6 @@ class QRMatrix{
3333
public const M_LOGO = 0b001000000000;
3434
/** @var int */
3535
public const M_LOGO_DARK = 0b101000000000;
36-
/** @var int */
37-
public const M_TEST = 0b011111111111;
38-
/** @var int */
39-
public const M_TEST_DARK = 0b111111111111;
4036

4137
/*
4238
* light values

src/Output/QROutputInterface.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ interface QROutputInterface{
8383
QRMatrix::M_QUIETZONE => false,
8484
QRMatrix::M_LOGO => false,
8585
QRMatrix::M_FINDER_DOT_LIGHT => false,
86-
QRMatrix::M_TEST => false,
8786
// dark
8887
QRMatrix::M_DARKMODULE => true,
8988
QRMatrix::M_DATA_DARK => true,
@@ -96,7 +95,6 @@ interface QROutputInterface{
9695
QRMatrix::M_QUIETZONE_DARK => true,
9796
QRMatrix::M_LOGO_DARK => true,
9897
QRMatrix::M_FINDER_DOT => true,
99-
QRMatrix::M_TEST_DARK => true,
10098
];
10199

102100
/**
@@ -118,7 +116,6 @@ interface QROutputInterface{
118116
QRMatrix::M_QUIETZONE => 'quietzone',
119117
QRMatrix::M_LOGO => 'logo',
120118
QRMatrix::M_FINDER_DOT_LIGHT => 'finder-dot-light',
121-
QRMatrix::M_TEST => 'test',
122119
// dark
123120
QRMatrix::M_DARKMODULE => 'darkmodule',
124121
QRMatrix::M_DATA_DARK => 'data-dark',
@@ -131,7 +128,6 @@ interface QROutputInterface{
131128
QRMatrix::M_QUIETZONE_DARK => 'quietzone-dark',
132129
QRMatrix::M_LOGO_DARK => 'logo-dark',
133130
QRMatrix::M_FINDER_DOT => 'finder-dot',
134-
QRMatrix::M_TEST_DARK => 'test-dark',
135131
];
136132

137133
/**

tests/Data/QRMatrixTest.php

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,6 @@ public static function debugMatrix(QRMatrix $matrix):void{
7979
QRMatrix::M_LOGO => QRString::ansi8('░░', 105),
8080
// empty
8181
QRMatrix::M_NULL => QRString::ansi8('░░', 231),
82-
// data
83-
QRMatrix::M_TEST_DARK => QRString::ansi8('██', 127),
84-
QRMatrix::M_TEST => QRString::ansi8('░░', 127),
8582
];
8683

8784
$out = (new QRString($opt, $matrix))->dump();
@@ -147,20 +144,20 @@ public function testMaskPattern():void{
147144
* Tests the set(), get() and check() methods
148145
*/
149146
public function testGetSetCheck():void{
150-
$this->matrix->set(10, 10, true, QRMatrix::M_TEST);
151-
$this::assertSame(QRMatrix::M_TEST_DARK, $this->matrix->get(10, 10));
147+
$this->matrix->set(10, 10, true, QRMatrix::M_LOGO);
148+
$this::assertSame(QRMatrix::M_LOGO_DARK, $this->matrix->get(10, 10));
152149
$this::assertTrue($this->matrix->check(10, 10));
153150

154-
$this->matrix->set(20, 20, false, QRMatrix::M_TEST);
155-
$this::assertSame(QRMatrix::M_TEST, $this->matrix->get(20, 20));
151+
$this->matrix->set(20, 20, false, QRMatrix::M_LOGO);
152+
$this::assertSame(QRMatrix::M_LOGO, $this->matrix->get(20, 20));
156153
$this::assertFalse($this->matrix->check(20, 20));
157154

158155
// get proper results when using a *_DARK constant
159-
$this->matrix->set(30, 30, true, QRMatrix::M_TEST_DARK);
160-
$this::assertSame(QRMatrix::M_TEST_DARK, $this->matrix->get(30, 30));
156+
$this->matrix->set(30, 30, true, QRMatrix::M_LOGO_DARK);
157+
$this::assertSame(QRMatrix::M_LOGO_DARK, $this->matrix->get(30, 30));
161158

162-
$this->matrix->set(40, 40, false, QRMatrix::M_TEST_DARK);
163-
$this::assertSame(QRMatrix::M_TEST, $this->matrix->get(40, 40));
159+
$this->matrix->set(40, 40, false, QRMatrix::M_LOGO_DARK);
160+
$this::assertSame(QRMatrix::M_LOGO, $this->matrix->get(40, 40));
164161

165162
// out of range
166163
$this::assertFalse($this->matrix->check(-1, -1));
@@ -331,8 +328,8 @@ public function testSetQuietZone(QRMatrix $matrix):void{
331328
$size = $matrix->getSize();
332329
$quietZoneSize = 5;
333330

334-
$matrix->set(0, 0, true, QRMatrix::M_TEST);
335-
$matrix->set(($size - 1), ($size - 1), true, QRMatrix::M_TEST);
331+
$matrix->set(0, 0, true, QRMatrix::M_LOGO);
332+
$matrix->set(($size - 1), ($size - 1), true, QRMatrix::M_LOGO);
336333

337334
$matrix->setQuietZone($quietZoneSize);
338335

@@ -350,8 +347,8 @@ public function testSetQuietZone(QRMatrix $matrix):void{
350347

351348
$s = ($size - 1 - $quietZoneSize);
352349

353-
$this::assertSame(QRMatrix::M_TEST_DARK, $matrix->get($quietZoneSize, $quietZoneSize));
354-
$this::assertSame(QRMatrix::M_TEST_DARK, $matrix->get($s, $s));
350+
$this::assertSame(QRMatrix::M_LOGO_DARK, $matrix->get($quietZoneSize, $quietZoneSize));
351+
$this::assertSame(QRMatrix::M_LOGO_DARK, $matrix->get($s, $s));
355352
}
356353

357354
/**
@@ -522,20 +519,20 @@ public function testSetLogoSpaceMaxSizeException():void{
522519
* Tests flipping the value of a module
523520
*/
524521
public function testFlip():void{
525-
$this->matrix->set(20, 20, true, QRMatrix::M_TEST);
522+
$this->matrix->set(20, 20, true, QRMatrix::M_LOGO);
526523

527524
// cover checkType()
528-
$this::assertTrue($this->matrix->checkType(20, 20, QRMatrix::M_TEST));
525+
$this::assertTrue($this->matrix->checkType(20, 20, QRMatrix::M_LOGO));
529526
// verify the current state (dark)
530-
$this::assertSame(QRMatrix::M_TEST_DARK, $this->matrix->get(20, 20));
527+
$this::assertSame(QRMatrix::M_LOGO_DARK, $this->matrix->get(20, 20));
531528
// flip
532529
$this->matrix->flip(20, 20);
533530
// verify flip
534-
$this::assertSame(QRMatrix::M_TEST, $this->matrix->get(20, 20));
531+
$this::assertSame(QRMatrix::M_LOGO, $this->matrix->get(20, 20));
535532
// flip again
536533
$this->matrix->flip(20, 20);
537534
// verify flip
538-
$this::assertSame(QRMatrix::M_TEST_DARK, $this->matrix->get(20, 20));
535+
$this::assertSame(QRMatrix::M_LOGO_DARK, $this->matrix->get(20, 20));
539536
}
540537

541538
/**

0 commit comments

Comments
 (0)