Skip to content

Commit 0abf25f

Browse files
committed
💄
1 parent 3c8af19 commit 0abf25f

File tree

5 files changed

+13
-25
lines changed

5 files changed

+13
-25
lines changed

tests/Helpers/BitBufferTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ protected function setUp(){
2828

2929
public function bitProvider(){
3030
return [
31-
[QRCode::DATA_NUMBER, 16],
32-
[QRCode::DATA_ALPHANUM, 32],
33-
[QRCode::DATA_BYTE, 64],
34-
[QRCode::DATA_KANJI, 128],
31+
'number' => [QRCode::DATA_NUMBER, 16],
32+
'alphanum' => [QRCode::DATA_ALPHANUM, 32],
33+
'byte' => [QRCode::DATA_BYTE, 64],
34+
'kanji' => [QRCode::DATA_KANJI, 128],
3535
];
3636
}
3737

tests/Output/QRMarkupTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ class QRMarkupTest extends QROutputTestAbstract{
2020

2121
public function types(){
2222
return [
23-
[QRCode::OUTPUT_MARKUP_HTML],
24-
[QRCode::OUTPUT_MARKUP_SVG],
23+
'html' => [QRCode::OUTPUT_MARKUP_HTML],
24+
'svg' => [QRCode::OUTPUT_MARKUP_SVG],
2525
];
2626
}
2727

tests/Output/QRStringTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ class QRStringTest extends QROutputTestAbstract{
2020

2121
public function types(){
2222
return [
23-
[QRCode::OUTPUT_STRING_JSON],
24-
[QRCode::OUTPUT_STRING_TEXT],
23+
'json' => [QRCode::OUTPUT_STRING_JSON],
24+
'text' => [QRCode::OUTPUT_STRING_TEXT],
2525
];
2626
}
2727

tests/QRCodeTest.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,6 @@ public function testRenderImage($type, $expected){
7070
$this->assertContains($expected, $this->qrcode->render('test'));
7171
}
7272

73-
/**
74-
* @expectedException \chillerlan\QRCode\QRCodeException
75-
* @expectedExceptionMessage Invalid error correct level: 42
76-
*/
77-
public function testSetOptionsException(){
78-
new QROptions(['eccLevel' => 42]);
79-
}
80-
8173
/**
8274
* @expectedException \chillerlan\QRCode\Output\QRCodeOutputException
8375
* @expectedExceptionMessage invalid output type

tests/QROptionsTest.php

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,15 @@ public function testVersionClamp(){
2626
$this->assertSame(40, (new QROptions(['version' => 42]))->version);
2727
$this->assertSame(1, (new QROptions(['version' => -42]))->version);
2828
$this->assertSame(21, (new QROptions(['version' => 21]))->version);
29-
$this->assertSame(QRCode::VERSION_AUTO, (new QROptions(['version' => QRCode::VERSION_AUTO]))->version); // -1
29+
$this->assertSame(QRCode::VERSION_AUTO, (new QROptions)->version); // QRCode::VERSION_AUTO = -1, default
3030
}
3131

3232
public function testVersionMinMaxClamp(){
3333
// normal clamp
3434
$o = new QROptions(['versionMin' => 5, 'versionMax' => 10]);
3535
$this->assertSame(5, $o->versionMin);
3636
$this->assertSame(10, $o->versionMax);
37+
3738
// exceeding values
3839
$o = new QROptions(['versionMin' => -42, 'versionMax' => 42]);
3940
$this->assertSame(1, $o->versionMin);
@@ -50,14 +51,9 @@ public function testVersionMinMaxClamp(){
5051
}
5152

5253
public function testMaskPatternClamp(){
53-
$o = new QROptions(['maskPattern' => 42]);
54-
$this->assertSame(7, $o->maskPattern);
55-
56-
$o = new QROptions(['maskPattern' => -42]);
57-
$this->assertSame(0, $o->maskPattern);
58-
59-
$o = new QROptions(['maskPattern' => QRCode::MASK_PATTERN_AUTO]); // -1
60-
$this->assertSame(QRCode::MASK_PATTERN_AUTO, $o->maskPattern);
54+
$this->assertSame(7, (new QROptions(['maskPattern' => 42]))->maskPattern);
55+
$this->assertSame(0, (new QROptions(['maskPattern' => -42]))->maskPattern);
56+
$this->assertSame(QRCode::MASK_PATTERN_AUTO, (new QROptions)->maskPattern); // QRCode::MASK_PATTERN_AUTO = -1, default
6157
}
6258

6359
/**

0 commit comments

Comments
 (0)