Give the feed of an empty site the current date.
The feed passed NULL to strtotime() when there were no stories.
This commit is contained in:
@@ -42,6 +42,17 @@ class FeedAndImageTest extends PageTestCase {
|
||||
$this->assertSame(date('D, d M Y H:i:s O', strtotime('2021-01-03 10:00:00')), (string)$xml->channel->lastBuildDate);
|
||||
}
|
||||
|
||||
// Without stories, the feed dates are the time of the request
|
||||
public function testTheFeedOfAnEmptySite(): void {
|
||||
$this->setTables(array());
|
||||
$xml = simplexml_load_string($this->get('/feed')['body']);
|
||||
$this->assertNotFalse($xml);
|
||||
$now = (string)$xml->channel->pubDate;
|
||||
$this->assertSame($now, (string)$xml->channel->lastBuildDate);
|
||||
$this->assertSame($now, (string)$xml->channel->item[0]->pubDate);
|
||||
$this->assertCount(1, $xml->channel->item);
|
||||
}
|
||||
|
||||
public function testAnImageIsServedWithItsRealType(): void {
|
||||
$image = $this->get('/display?id=2');
|
||||
$this->assertSame(200, $image['status']);
|
||||
|
||||
Reference in New Issue
Block a user