:octocat: require only either $logoSpaceWidth or $logoSpaceHeight

This commit is contained in:
smiley
2023-01-28 16:47:34 +01:00
parent 571d3ea1d9
commit eeb7169d68
5 changed files with 56 additions and 11 deletions
+22
View File
@@ -352,6 +352,28 @@ final class QRMatrixTest extends TestCase{
$this->matrix->setQuietZone(42);
}
/**
* Tests if the logo space is drawn square if one of the dimensions is omitted
*/
public function testSetLogoSpaceOmitHeight():void{
$o = new QROptions;
$o->version = 2;
$o->eccLevel = EccLevel::H;
$o->addQuietzone = false;
$o->addLogoSpace = true;
$o->logoSpaceHeight = 5;
$matrix = (new QRCode($o))->addByteSegment('testdata')->getMatrix();
self::debugMatrix($matrix);
$this::assertFalse($matrix->checkType(9, 9, QRMatrix::M_LOGO));
$this::assertTrue($matrix->checkType(10, 10, QRMatrix::M_LOGO));
$this::assertTrue($matrix->checkType(14, 14, QRMatrix::M_LOGO));
$this::assertFalse($matrix->checkType(15, 15, QRMatrix::M_LOGO));
}
/**
* Tests the auto orientation of the logo space
*/