$data = $feedBuilder->buildData();
// Test headers (RSS)
$this->assertEquals(self::$RSS_LANGUAGE, $data['language']);
- $this->assertEmpty($data['pubsubhub_url']);
$this->assertRegExp('/Wed, 03 Aug 2016 09:30:33 \+\d{4}/', $data['last_update']);
$this->assertEquals(true, $data['show_dates']);
$this->assertEquals('http://host.tld/index.php?do=feed', $data['self_link']);
// Test first link (note link)
$link = reset($data['links']);
$this->assertEquals(41, $link['id']);
- $this->assertEquals(DateTime::createFromFormat('Ymd_His', '20150310_114651'), $link['created']);
+ $this->assertEquals(DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, '20150310_114651'), $link['created']);
$this->assertEquals('http://host.tld/?WDWyig', $link['guid']);
$this->assertEquals('http://host.tld/?WDWyig', $link['url']);
$this->assertRegExp('/Tue, 10 Mar 2015 11:46:51 \+\d{4}/', $link['pub_iso_date']);
$this->assertEquals(1, count($data['links']));
$link = array_shift($data['links']);
$this->assertEquals(41, $link['id']);
- $this->assertEquals(DateTime::createFromFormat('Ymd_His', '20150310_114651'), $link['created']);
+ $this->assertEquals(DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, '20150310_114651'), $link['created']);
}
/**
$this->assertEquals(1, count($data['links']));
$link = array_shift($data['links']);
$this->assertEquals(41, $link['id']);
- $this->assertEquals(DateTime::createFromFormat('Ymd_His', '20150310_114651'), $link['created']);
+ $this->assertEquals(DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, '20150310_114651'), $link['created']);
}
/**
// First link is a permalink
$link = array_shift($data['links']);
$this->assertEquals(41, $link['id']);
- $this->assertEquals(DateTime::createFromFormat('Ymd_His', '20150310_114651'), $link['created']);
+ $this->assertEquals(DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, '20150310_114651'), $link['created']);
$this->assertEquals('http://host.tld/?WDWyig', $link['guid']);
$this->assertEquals('http://host.tld/?WDWyig', $link['url']);
$this->assertContains('Direct link', $link['description']);
// Second link is a direct link
$link = array_shift($data['links']);
$this->assertEquals(8, $link['id']);
- $this->assertEquals(DateTime::createFromFormat('Ymd_His', '20150310_114633'), $link['created']);
+ $this->assertEquals(DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, '20150310_114633'), $link['created']);
$this->assertEquals('http://host.tld/?RttfEw', $link['guid']);
$this->assertEquals('https://static.fsf.org/nosvn/faif-2.0.pdf', $link['url']);
$this->assertContains('Direct link', $link['description']);
$this->assertTrue($data['show_dates']);
}
- /**
- * Test buildData with hide dates settings.
- */
- public function testBuildDataPubsubhub()
- {
- $feedBuilder = new FeedBuilder(self::$linkDB, FeedBuilder::$FEED_ATOM, self::$serverInfo, null, false);
- $feedBuilder->setLocale(self::$LOCALE);
- $feedBuilder->setPubsubhubUrl('http://pubsubhub.io');
- $data = $feedBuilder->buildData();
- $this->assertEquals(ReferenceLinkDB::$NB_LINKS_TOTAL, count($data['links']));
- $this->assertEquals('http://pubsubhub.io', $data['pubsubhub_url']);
- }
-
/**
* Test buildData when Shaarli is served from a subdirectory
*/