Browse Source

Generalize icon fetching tests

rpm
J. King 4 years ago
parent
commit
bd650765e1
  1. 1
      .gitignore
  2. 8
      tests/cases/Feed/TestFeed.php
  3. 2
      tests/docroot/Feed/WithIcon/GIF.php
  4. 8
      tests/docroot/Feed/WithIcon/PNG.php
  5. 8
      tests/docroot/Feed/WithIcon/SVG1.php
  6. 8
      tests/docroot/Feed/WithIcon/SVG2.php
  7. 4
      tests/docroot/Icon/GIF.php
  8. 0
      tests/docroot/Icon/PNG.php
  9. 4
      tests/docroot/Icon/SVG1.php
  10. 4
      tests/docroot/Icon/SVG2.php

1
.gitignore

@ -26,7 +26,6 @@ $RECYCLE.BIN/
.DS_Store
.AppleDouble
.LSOverride
Icon
._*
.Spotlight-V100
.Trashes

8
tests/cases/Feed/TestFeed.php

@ -349,10 +349,10 @@ class TestFeed extends \JKingWeb\Arsse\Test\AbstractTest {
}
public function testFetchWithIcon(): void {
$d = base64_decode("iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAZdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuMjHxIGmVAAAADUlEQVQYV2NgYGBgAAAABQABijPjAAAAAABJRU5ErkJggg==");
$f = new Feed(null, $this->base."Parsing/WithIcon");
$this->assertSame(self::$host."Icon", $f->iconUrl);
$this->assertSame("image/png", $f->iconType);
$d = base64_decode("R0lGODlhAQABAIABAAAAAP///yH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==");
$f = new Feed(null, $this->base."WithIcon/GIF");
$this->assertSame(self::$host."Icon/GIF", $f->iconUrl);
$this->assertSame("image/gif", $f->iconType);
$this->assertSame($d, $f->iconData);
}
}

2
tests/docroot/Feed/Parsing/WithIcon.php → tests/docroot/Feed/WithIcon/GIF.php

@ -2,7 +2,7 @@
'mime' => "application/atom+xml",
'content' => <<<MESSAGE_BODY
<feed xmlns="http://www.w3.org/2005/Atom">
<icon>/Icon</icon>
<icon>/Icon/GIF</icon>
</feed>
MESSAGE_BODY
];

8
tests/docroot/Feed/WithIcon/PNG.php

@ -0,0 +1,8 @@
<?php return [
'mime' => "application/atom+xml",
'content' => <<<MESSAGE_BODY
<feed xmlns="http://www.w3.org/2005/Atom">
<icon>/Icon/PNG</icon>
</feed>
MESSAGE_BODY
];

8
tests/docroot/Feed/WithIcon/SVG1.php

@ -0,0 +1,8 @@
<?php return [
'mime' => "application/atom+xml",
'content' => <<<MESSAGE_BODY
<feed xmlns="http://www.w3.org/2005/Atom">
<icon>/Icon/SVG1</icon>
</feed>
MESSAGE_BODY
];

8
tests/docroot/Feed/WithIcon/SVG2.php

@ -0,0 +1,8 @@
<?php return [
'mime' => "application/atom+xml",
'content' => <<<MESSAGE_BODY
<feed xmlns="http://www.w3.org/2005/Atom">
<icon>/Icon/SVG2</icon>
</feed>
MESSAGE_BODY
];

4
tests/docroot/Icon/GIF.php

@ -0,0 +1,4 @@
<?php return [
'mime' => "image/gif",
'content' => base64_decode("R0lGODlhAQABAIABAAAAAP///yH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="),
];

0
tests/docroot/Icon.php → tests/docroot/Icon/PNG.php

4
tests/docroot/Icon/SVG1.php

@ -0,0 +1,4 @@
<?php return [
'mime' => "image/svg+xml",
'content' => '<svg xmlns="http://www.w3.org/2000/svg" width="900" height="600"><rect fill="#fff" height="600" width="900"/><circle fill="#bc002d" cx="450" cy="300" r="180"/></svg>'
];

4
tests/docroot/Icon/SVG2.php

@ -0,0 +1,4 @@
<?php return [
'mime' => "image/svg+xml",
'content' => '<svg xmlns="http://www.w3.org/2000/svg" width="900" height="600"><rect width="900" height="600" fill="#ED2939"/><rect width="600" height="600" fill="#fff"/><rect width="300" height="600" fill="#002395"/></svg>'
];
Loading…
Cancel
Save