1
1
Fork 0
mirror of https://code.mensbeam.com/MensBeam/Arsse.git synced 2024-12-22 21:22:40 +00:00

Generalize icon fetching tests

This commit is contained in:
J. King 2020-11-05 12:12:01 -05:00
parent 50fd127ac4
commit bd650765e1
10 changed files with 41 additions and 6 deletions

1
.gitignore vendored
View file

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

View file

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

View file

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

View file

@ -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
];

View file

@ -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
];

View file

@ -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
];

View file

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

View file

@ -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>'
];

View file

@ -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>'
];