Skip to content

Commit

Permalink
qual: add test assertions on image sizes
Browse files Browse the repository at this point in the history
Expected to fail because in the current implementation,
Image::fromString() calculates the image size but
methods like PNG::fromString() and JPEG::fromFile()
don't.
  • Loading branch information
lourot committed Nov 14, 2024
1 parent 88e45ed commit 7b80532
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/Format/JPEGTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ public function testGetXmp($method, $filename, $expectedHeadline)
throw new \InvalidArgumentException("Invalid method: $method");
}

$this->assertInstanceOf(JPEG::class, $jpeg);
$this->assertGreaterThan(0, $jpeg->getSize()["width"]);

$xmp = $jpeg->getXmp();

$this->assertInstanceOf(Xmp::class, $xmp);
Expand Down
3 changes: 3 additions & 0 deletions tests/Format/PNGTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ public function testGetXmp($method, $filename, $expectedPhotographerName, $expec
throw new \InvalidArgumentException("Invalid method: $method");
}

$this->assertInstanceOf(PNG::class, $png);
$this->assertGreaterThan(0, $png->getSize()["width"]);

$xmp = $png->getXmp();

$this->assertInstanceOf(Xmp::class, $xmp);
Expand Down
1 change: 1 addition & 0 deletions tests/Format/WebPTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public function testValidWebP($method, $filename, $expectedHeadline)
}

$this->assertInstanceOf(WebP::class, $webp);
$this->assertGreaterThan(0, $webp->getSize()["width"]);

$xmp = $webp->getXmp();

Expand Down

0 comments on commit 7b80532

Please sign in to comment.