🚿 static calls to TestCase::assert*

This commit is contained in:
codemasher
2020-02-19 21:04:36 +01:00
parent 551150b226
commit 41730158d7
12 changed files with 94 additions and 94 deletions
+36 -36
View File
@@ -46,56 +46,56 @@ class QRMatrixTest extends QRTestAbstract{
}
public function testInstance(){
$this->assertInstanceOf($this->FQCN, $this->matrix);
$this::assertInstanceOf($this->FQCN, $this->matrix);
}
public function testSize(){
$this->assertCount($this->matrix->size(), $this->matrix->matrix());
$this::assertCount($this->matrix->size(), $this->matrix->matrix());
}
public function testVersion(){
$this->assertSame($this->version, $this->matrix->version());
$this::assertSame($this->version, $this->matrix->version());
}
public function testECC(){
$this->assertSame(QRCode::ECC_L, $this->matrix->eccLevel());
$this::assertSame(QRCode::ECC_L, $this->matrix->eccLevel());
}
public function testMaskPattern(){
$this->assertSame(-1, $this->matrix->maskPattern());
$this::assertSame(-1, $this->matrix->maskPattern());
}
public function testGetSetCheck(){
$this->matrix->set(10, 10, true, QRMatrix::M_TEST);
$this->assertSame(65280, $this->matrix->get(10, 10));
$this->assertTrue($this->matrix->check(10, 10));
$this::assertSame(65280, $this->matrix->get(10, 10));
$this::assertTrue($this->matrix->check(10, 10));
$this->matrix->set(20, 20, false, QRMatrix::M_TEST);
$this->assertSame(255, $this->matrix->get(20, 20));
$this->assertFalse($this->matrix->check(20, 20));
$this::assertSame(255, $this->matrix->get(20, 20));
$this::assertFalse($this->matrix->check(20, 20));
}
public function testSetDarkModule(){
$this->matrix->setDarkModule();
$this->assertSame(QRMatrix::M_DARKMODULE << 8, $this->matrix->get(8, $this->matrix->size() - 8));
$this::assertSame(QRMatrix::M_DARKMODULE << 8, $this->matrix->get(8, $this->matrix->size() - 8));
}
public function testSetFinderPattern(){
$this->matrix->setFinderPattern();
$this->assertSame(QRMatrix::M_FINDER << 8, $this->matrix->get(0, 0));
$this->assertSame(QRMatrix::M_FINDER << 8, $this->matrix->get(0, $this->matrix->size() - 1));
$this->assertSame(QRMatrix::M_FINDER << 8, $this->matrix->get($this->matrix->size() - 1, 0));
$this::assertSame(QRMatrix::M_FINDER << 8, $this->matrix->get(0, 0));
$this::assertSame(QRMatrix::M_FINDER << 8, $this->matrix->get(0, $this->matrix->size() - 1));
$this::assertSame(QRMatrix::M_FINDER << 8, $this->matrix->get($this->matrix->size() - 1, 0));
}
public function testSetSeparators(){
$this->matrix->setSeparators();
$this->assertSame(QRMatrix::M_SEPARATOR, $this->matrix->get(7, 0));
$this->assertSame(QRMatrix::M_SEPARATOR, $this->matrix->get(0, 7));
$this->assertSame(QRMatrix::M_SEPARATOR, $this->matrix->get(0, $this->matrix->size() - 8));
$this->assertSame(QRMatrix::M_SEPARATOR, $this->matrix->get($this->matrix->size() - 8, 0));
$this::assertSame(QRMatrix::M_SEPARATOR, $this->matrix->get(7, 0));
$this::assertSame(QRMatrix::M_SEPARATOR, $this->matrix->get(0, 7));
$this::assertSame(QRMatrix::M_SEPARATOR, $this->matrix->get(0, $this->matrix->size() - 8));
$this::assertSame(QRMatrix::M_SEPARATOR, $this->matrix->get($this->matrix->size() - 8, 0));
}
public function testSetAlignmentPattern(){
@@ -110,11 +110,11 @@ class QRMatrixTest extends QRTestAbstract{
foreach($alignmentPattern as $px){
if($this->matrix->get($px, $py) === QRMatrix::M_FINDER << 8){
$this->assertSame(QRMatrix::M_FINDER << 8, $this->matrix->get($px, $py), 'skipped finder pattern');
$this::assertSame(QRMatrix::M_FINDER << 8, $this->matrix->get($px, $py), 'skipped finder pattern');
continue;
}
$this->assertSame(QRMatrix::M_ALIGNMENT << 8, $this->matrix->get($px, $py));
$this::assertSame(QRMatrix::M_ALIGNMENT << 8, $this->matrix->get($px, $py));
}
}
@@ -133,12 +133,12 @@ class QRMatrixTest extends QRTestAbstract{
$p1 = $this->matrix->get(6, $i);
if($p1 === QRMatrix::M_ALIGNMENT << 8){
$this->assertSame(QRMatrix::M_ALIGNMENT << 8, $p1, 'skipped alignment pattern');
$this::assertSame(QRMatrix::M_ALIGNMENT << 8, $p1, 'skipped alignment pattern');
continue;
}
$this->assertSame(QRMatrix::M_TIMING << 8, $p1);
$this->assertSame(QRMatrix::M_TIMING << 8, $this->matrix->get($i, 6));
$this::assertSame(QRMatrix::M_TIMING << 8, $p1);
$this::assertSame(QRMatrix::M_TIMING << 8, $this->matrix->get($i, 6));
}
}
}
@@ -146,19 +146,19 @@ class QRMatrixTest extends QRTestAbstract{
public function testSetVersionNumber(){
$this->matrix->setVersionNumber(true);
$this->assertSame(QRMatrix::M_VERSION, $this->matrix->get($this->matrix->size() - 9, 0));
$this->assertSame(QRMatrix::M_VERSION, $this->matrix->get($this->matrix->size() - 11, 5));
$this->assertSame(QRMatrix::M_VERSION, $this->matrix->get(0, $this->matrix->size() - 9));
$this->assertSame(QRMatrix::M_VERSION, $this->matrix->get(5, $this->matrix->size() - 11));
$this::assertSame(QRMatrix::M_VERSION, $this->matrix->get($this->matrix->size() - 9, 0));
$this::assertSame(QRMatrix::M_VERSION, $this->matrix->get($this->matrix->size() - 11, 5));
$this::assertSame(QRMatrix::M_VERSION, $this->matrix->get(0, $this->matrix->size() - 9));
$this::assertSame(QRMatrix::M_VERSION, $this->matrix->get(5, $this->matrix->size() - 11));
}
public function testSetFormatInfo(){
$this->matrix->setFormatInfo(0, true);
$this->assertSame(QRMatrix::M_FORMAT, $this->matrix->get(8, 0));
$this->assertSame(QRMatrix::M_FORMAT, $this->matrix->get(0, 8));
$this->assertSame(QRMatrix::M_FORMAT, $this->matrix->get($this->matrix->size() - 1, 8));
$this->assertSame(QRMatrix::M_FORMAT, $this->matrix->get($this->matrix->size() - 8, 8));
$this::assertSame(QRMatrix::M_FORMAT, $this->matrix->get(8, 0));
$this::assertSame(QRMatrix::M_FORMAT, $this->matrix->get(0, 8));
$this::assertSame(QRMatrix::M_FORMAT, $this->matrix->get($this->matrix->size() - 1, 8));
$this::assertSame(QRMatrix::M_FORMAT, $this->matrix->get($this->matrix->size() - 8, 8));
}
public function testSetQuietZone(){
@@ -170,15 +170,15 @@ class QRMatrixTest extends QRTestAbstract{
$this->matrix->setQuietZone($q);
$this->assertCount($size + 2 * $q, $this->matrix->matrix());
$this->assertCount($size + 2 * $q, $this->matrix->matrix()[$size - 1]);
$this::assertCount($size + 2 * $q, $this->matrix->matrix());
$this::assertCount($size + 2 * $q, $this->matrix->matrix()[$size - 1]);
$size = $this->matrix->size();
$this->assertSame(QRMatrix::M_QUIETZONE, $this->matrix->get(0, 0));
$this->assertSame(QRMatrix::M_QUIETZONE, $this->matrix->get($size - 1, $size - 1));
$this::assertSame(QRMatrix::M_QUIETZONE, $this->matrix->get(0, 0));
$this::assertSame(QRMatrix::M_QUIETZONE, $this->matrix->get($size - 1, $size - 1));
$this->assertSame(QRMatrix::M_TEST << 8, $this->matrix->get($q, $q));
$this->assertSame(QRMatrix::M_TEST << 8, $this->matrix->get($size - 1 - $q, $size - 1 - $q));
$this::assertSame(QRMatrix::M_TEST << 8, $this->matrix->get($q, $q));
$this::assertSame(QRMatrix::M_TEST << 8, $this->matrix->get($size - 1 - $q, $size - 1 - $q));
}
public function testSetQuietZoneException(){