mirror of
https://github.com/chillerlan/php-qrcode.git
synced 2026-08-23 09:21:49 +00:00
:octocat: +coverage
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user