We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 826c3ac commit 3c8af19Copy full SHA for 3c8af19
tests/QROptionsTest.php
@@ -67,4 +67,20 @@ public function testMaskPatternClamp(){
67
public function testInvalidEccLevelException(){
68
new QROptions(['eccLevel' => 42]);
69
}
70
+
71
+ public function testClampRGBValues(){
72
+ $o = new QROptions(['imageTransparencyBG' => [-1, 0, 999]]);
73
74
+ $this->assertSame(0, $o->imageTransparencyBG[0]);
75
+ $this->assertSame(0, $o->imageTransparencyBG[1]);
76
+ $this->assertSame(255, $o->imageTransparencyBG[2]);
77
+ }
78
79
+ /**
80
+ * @expectedException \chillerlan\QRCode\QRCodeException
81
+ * @expectedExceptionMessage Invalid RGB value.
82
+ */
83
+ public function testInvalidRGBValueException(){
84
+ new QROptions(['imageTransparencyBG' => ['r', 'g', 'b']]);
85
86
0 commit comments