mirror of
https://code.mensbeam.com/MensBeam/Arsse.git
synced 2024-12-22 13:12:41 +00:00
Generalize icon fetching tests
This commit is contained in:
parent
50fd127ac4
commit
bd650765e1
10 changed files with 41 additions and 6 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -26,7 +26,6 @@ $RECYCLE.BIN/
|
||||||
.DS_Store
|
.DS_Store
|
||||||
.AppleDouble
|
.AppleDouble
|
||||||
.LSOverride
|
.LSOverride
|
||||||
Icon
|
|
||||||
._*
|
._*
|
||||||
.Spotlight-V100
|
.Spotlight-V100
|
||||||
.Trashes
|
.Trashes
|
||||||
|
|
|
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
||||||
];
|
];
|
8
tests/docroot/Feed/WithIcon/PNG.php
Normal file
8
tests/docroot/Feed/WithIcon/PNG.php
Normal 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
|
||||||
|
];
|
8
tests/docroot/Feed/WithIcon/SVG1.php
Normal file
8
tests/docroot/Feed/WithIcon/SVG1.php
Normal 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
|
||||||
|
];
|
8
tests/docroot/Feed/WithIcon/SVG2.php
Normal file
8
tests/docroot/Feed/WithIcon/SVG2.php
Normal 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
|
||||||
|
];
|
4
tests/docroot/Icon/GIF.php
Normal file
4
tests/docroot/Icon/GIF.php
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
<?php return [
|
||||||
|
'mime' => "image/gif",
|
||||||
|
'content' => base64_decode("R0lGODlhAQABAIABAAAAAP///yH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="),
|
||||||
|
];
|
4
tests/docroot/Icon/SVG1.php
Normal file
4
tests/docroot/Icon/SVG1.php
Normal 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>'
|
||||||
|
];
|
4
tests/docroot/Icon/SVG2.php
Normal file
4
tests/docroot/Icon/SVG2.php
Normal 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>'
|
||||||
|
];
|
Loading…
Reference in a new issue