codemasher 6 лет назад
Родитель
Сommit
b5cfa07f32

+ 14 - 0
tests/Output/QRMarkupTest.php

@@ -60,4 +60,18 @@ class QRMarkupTest extends QROutputTestAbstract{
 		$this->assertSame(trim($expected), trim($this->outputInterface->dump()));
 	}
 
+	public function testSetModuleValues(){
+
+		$this->options->moduleValues = [
+			// data
+			1024 => '#4A6000',
+			4    => '#ECF9BE',
+		];
+
+		$this->setOutputInterface();
+		$data = $this->outputInterface->dump();
+		$this->assertStringContainsString('#4A6000', $data);
+		$this->assertStringContainsString('#ECF9BE', $data);
+	}
+
 }

+ 1 - 1
tests/Output/QROutputTestAbstract.php

@@ -41,7 +41,7 @@ abstract class QROutputTestAbstract extends QRTestAbstract{
 	protected function setUp():void{
 		parent::setUp();
 
-		$this->options         = new QROptions;
+		$this->options = new QROptions;
 		$this->setOutputInterface();
 	}
 

+ 15 - 0
tests/Output/QRStringTest.php

@@ -38,4 +38,19 @@ class QRStringTest extends QROutputTestAbstract{
 		$this->assertSame($data, file_get_contents($this->options->cachefile));
 	}
 
+	public function testSetModuleValues(){
+
+		$this->options->moduleValues = [
+			// data
+			1024 => 'A',
+			4    => 'B',
+		];
+
+		$this->setOutputInterface();
+		$data = $this->outputInterface->dump();
+
+		$this->assertStringContainsString('A', $data);
+		$this->assertStringContainsString('B', $data);
+	}
+
 }