mirror of
https://code.mensbeam.com/MensBeam/Arsse.git
synced 2025-01-03 14:32:40 +00:00
Last cache-handling Feed test
This commit is contained in:
parent
ed3e3c12d6
commit
148875c0dd
7 changed files with 37 additions and 3 deletions
|
@ -53,12 +53,17 @@ class TestFeed extends \PHPUnit\Framework\TestCase {
|
|||
$this->assertNotEmpty($f->resource->getETag());
|
||||
// these tests have no HTTP headers and rely on article dates
|
||||
$t = strtotime("2002-05-19T15:21:36Z");
|
||||
$f = new Feed(null, $this->base."Caching/200RSS2PubDateOnly");
|
||||
$f = new Feed(null, $this->base."Caching/200PubDateOnly");
|
||||
$this->assertTime($t, $f->lastModified);
|
||||
$f = new Feed(null, $this->base."Caching/200RSS2UpdateDate");
|
||||
$f = new Feed(null, $this->base."Caching/200UpdateDate");
|
||||
$this->assertTime($t, $f->lastModified);
|
||||
$f = new Feed(null, $this->base."Caching/200RSS2Multiple");
|
||||
$f = new Feed(null, $this->base."Caching/200Multiple");
|
||||
$this->assertTime($t, $f->lastModified);
|
||||
// this test has no dates at all and should report the current time
|
||||
$t = time();
|
||||
$f = new Feed(null, $this->base."Caching/200None");
|
||||
$this->assertTime($t, $f->lastModified);
|
||||
|
||||
}
|
||||
|
||||
function testComputeNextFetchOnError() {
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
<?php return [
|
||||
'code' => 200,
|
||||
'mime' => "application/rss+xml",
|
||||
'lastMod' => time() + 2000,
|
||||
'content' => <<<MESSAGE_BODY
|
||||
<rss version="2.0">
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<?php return [
|
||||
'code' => 200,
|
||||
'cache' => false,
|
||||
'mime' => "application/rss+xml",
|
||||
'content' => <<<MESSAGE_BODY
|
||||
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
|
||||
<channel>
|
24
tests/docroot/Feed/Caching/200None.php
Normal file
24
tests/docroot/Feed/Caching/200None.php
Normal file
|
@ -0,0 +1,24 @@
|
|||
<?php return [
|
||||
'code' => 200,
|
||||
'cache' => false,
|
||||
'mime' => "application/rss+xml",
|
||||
'content' => <<<MESSAGE_BODY
|
||||
<rss version="2.0">
|
||||
<channel>
|
||||
<title>Test feed</title>
|
||||
<link>http://example.com/</link>
|
||||
<description>A basic feed for testing</description>
|
||||
|
||||
<item>
|
||||
<description>Sample article 1</description>
|
||||
</item>
|
||||
<item>
|
||||
<description>Sample article 2</description>
|
||||
</item>
|
||||
<item>
|
||||
<description>Sample article 3</description>
|
||||
</item>
|
||||
</channel>
|
||||
</rss>
|
||||
MESSAGE_BODY
|
||||
];
|
|
@ -1,6 +1,7 @@
|
|||
<?php return [
|
||||
'code' => 200,
|
||||
'lastMod' => time() - 2000,
|
||||
'mime' => "application/rss+xml",
|
||||
'content' => <<<MESSAGE_BODY
|
||||
<rss version="2.0">
|
||||
<channel>
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<?php return [
|
||||
'code' => 200,
|
||||
'cache' => false,
|
||||
'mime' => "application/rss+xml",
|
||||
'content' => <<<MESSAGE_BODY
|
||||
<rss version="2.0">
|
||||
<channel>
|
|
@ -1,6 +1,7 @@
|
|||
<?php return [
|
||||
'code' => 200,
|
||||
'cache' => false,
|
||||
'mime' => "application/rss+xml",
|
||||
'content' => <<<MESSAGE_BODY
|
||||
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
|
||||
<channel>
|
Loading…
Reference in a new issue