X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=tests%2FFeedBuilderTest.php;h=06a445064db3aab7c46fceda27ba08b205d1a143;hb=9cf93bcfc53c36e0dd59fcfc717ac483ee74b35a;hp=ea1dde25cd09674775b4f5f2effcdb8a0d8f8e33;hpb=c3dfd8995921083ff7250c25d0b6ab1184b91aff;p=github%2Fshaarli%2FShaarli.git diff --git a/tests/FeedBuilderTest.php b/tests/FeedBuilderTest.php index ea1dde25..06a44506 100644 --- a/tests/FeedBuilderTest.php +++ b/tests/FeedBuilderTest.php @@ -86,7 +86,7 @@ class FeedBuilderTest extends PHPUnit_Framework_TestCase // 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']); @@ -140,7 +140,7 @@ class FeedBuilderTest extends PHPUnit_Framework_TestCase $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']); } /** @@ -157,7 +157,7 @@ class FeedBuilderTest extends PHPUnit_Framework_TestCase $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']); } /** @@ -174,7 +174,7 @@ class FeedBuilderTest extends PHPUnit_Framework_TestCase // 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']); @@ -182,7 +182,7 @@ class FeedBuilderTest extends PHPUnit_Framework_TestCase // 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']);