diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2015-02-27 09:19:51 +0100 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2015-02-27 09:19:59 +0100 |
commit | ea4ecf501fc83134db2201477b4cdb1806d5312c (patch) | |
tree | 3f037329e0b7dead6c97fd58182013bc3d097667 /vendor/fguillot/picofeed/tests/Parser/DateParserTest.php | |
parent | 790f0a0a709510092546c5ca4347bbec5f0a19c2 (diff) |
update picofeed
Diffstat (limited to 'vendor/fguillot/picofeed/tests/Parser/DateParserTest.php')
-rw-r--r-- | vendor/fguillot/picofeed/tests/Parser/DateParserTest.php | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/vendor/fguillot/picofeed/tests/Parser/DateParserTest.php b/vendor/fguillot/picofeed/tests/Parser/DateParserTest.php index 6ad464bf3..ab35d0b8b 100644 --- a/vendor/fguillot/picofeed/tests/Parser/DateParserTest.php +++ b/vendor/fguillot/picofeed/tests/Parser/DateParserTest.php @@ -12,37 +12,37 @@ class DateParserTest extends PHPUnit_Framework_TestCase date_default_timezone_set('UTC'); - $this->assertEquals(1359066183, $parser->getTimestamp('Thu, 24 Jan 2013 22:23:03 +0000')); - $this->assertEquals(1362992761, $parser->getTimestamp('2013-03-11T09:06:01+00:00')); - $this->assertEquals(1363752990, $parser->getTimestamp('2013-03-20T04:16:30+00:00')); - $this->assertEquals(1359066183, $parser->getTimestamp('Thu, 24 Jan 2013 22:23:03 +0000')); - $this->assertEquals(1380929699, $parser->getTimestamp('Sat, 04 Oct 2013 02:34:59 +0300')); - $this->assertEquals(1054633161, $parser->getTimestamp('Tue, 03 Jun 2003 09:39:21 GMT')); - $this->assertEquals(1071340202, $parser->getTimestamp('2003-12-13T18:30:02Z')); - $this->assertEquals(1364234797, $parser->getTimestamp('Mon, 25 Mar 2013 19:06:37 +0100')); - $this->assertEquals(1360054941, $parser->getTimestamp('2013-02-05T09:02:21.880-08:00')); - $this->assertEquals(1286834400, $parser->getTimestamp('Tue, 12 Oct 2010 00:00:00 IST')); - $this->assertEquals('2014-12-15 19:49', date('Y-m-d H:i', $parser->getTimestamp('15 Dec 2014 19:49:07 +0100'))); - $this->assertEquals('2012-05-15', date('Y-m-d', $parser->getTimestamp('Tue, 15 May 2012 24:05:00 UTC'))); - $this->assertEquals('2013-09-12', date('Y-m-d', $parser->getTimestamp('Thu, 12 Sep 2013 7:00:00 UTC'))); - $this->assertEquals('2012-01-31', date('Y-m-d', $parser->getTimestamp('01.31.2012'))); - $this->assertEquals('2012-01-31', date('Y-m-d', $parser->getTimestamp('01/31/2012'))); - $this->assertEquals('2012-01-31', date('Y-m-d', $parser->getTimestamp('2012-01-31'))); - $this->assertEquals('2010-02-24', date('Y-m-d', $parser->getTimestamp('2010-02-245T15:27:52Z'))); - $this->assertEquals('2010-08-20', date('Y-m-d', $parser->getTimestamp('2010-08-20Thh:08:ssZ'))); - $this->assertEquals(1288648057, $parser->getTimestamp('Mon, 01 Nov 2010 21:47:37 UT')); - $this->assertEquals(1346069615, $parser->getTimestamp('Mon Aug 27 2012 12:13:35 GMT-0700 (PDT)')); - $this->assertEquals(time(), $parser->getTimestamp('Tue, 3 Febuary 2010 00:00:00 IST'), '', 1); - $this->assertEquals(time(), $parser->getTimestamp('############# EST'), '', 1); - $this->assertEquals(time(), $parser->getTimestamp('Wed, 30 Nov -0001 00:00:00 +0000'), '', 1); - $this->assertEquals(time(), $parser->getTimestamp('čet, 24 maj 2012 00:00:00'), '', 1); - $this->assertEquals(time(), $parser->getTimestamp('-0-0T::Z'), '', 1); - $this->assertEquals(time(), $parser->getTimestamp('Wed, 18 2012'), '', 1); - $this->assertEquals(time(), $parser->getTimestamp("'2009-09-30 CDT16:09:54"), '', 1); - $this->assertEquals(time(), $parser->getTimestamp('ary 8 Jan 2013 00:00:00 GMT'), '', 1); - $this->assertEquals(time(), $parser->getTimestamp('Sat, 11 00:00:01 GMT'), '', 1); - $this->assertEquals(1370631743, $parser->getTimestamp('Fri Jun 07 2013 19:02:23 GMT+0000 (UTC)')); - $this->assertEquals(1377412225, $parser->getTimestamp('25/08/2013 06:30:25 م')); - $this->assertEquals(time(), $parser->getTimestamp('+0400'), '', 1); + $this->assertEquals(1359066183, $parser->getDateTime('Thu, 24 Jan 2013 22:23:03 +0000')->getTimestamp(), '', 1); + $this->assertEquals(1362992761, $parser->getDateTime('2013-03-11T09:06:01+00:00')->getTimestamp(), '', 1); + $this->assertEquals(1363752990, $parser->getDateTime('2013-03-20T04:16:30+00:00')->getTimestamp(), '', 1); + $this->assertEquals(1359066183, $parser->getDateTime('Thu, 24 Jan 2013 22:23:03 +0000')->getTimestamp(), '', 1); + $this->assertEquals(1380929699, $parser->getDateTime('Sat, 04 Oct 2013 02:34:59 +0300')->getTimestamp(), '', 1); + $this->assertEquals(1054633161, $parser->getDateTime('Tue, 03 Jun 2003 09:39:21 GMT')->getTimestamp(), '', 1); + $this->assertEquals(1071340202, $parser->getDateTime('2003-12-13T18:30:02Z')->getTimestamp(), '', 1); + $this->assertEquals(1364234797, $parser->getDateTime('Mon, 25 Mar 2013 19:06:37 +0100')->getTimestamp(), '', 1); + $this->assertEquals(1360054941, $parser->getDateTime('2013-02-05T09:02:21.880-08:00')->getTimestamp(), '', 1); + $this->assertEquals(1286834400, $parser->getDateTime('Tue, 12 Oct 2010 00:00:00 IST')->getTimestamp(), '', 1); + $this->assertEquals('2014-12-15 19:49', $parser->getDateTime('15 Dec 2014 19:49:07 +0100')->format('Y-m-d H:i')); + $this->assertEquals('2012-05-15', $parser->getDateTime('Tue, 15 May 2012 24:05:00 UTC')->format('Y-m-d')); + $this->assertEquals('2013-09-12', $parser->getDateTime('Thu, 12 Sep 2013 7:00:00 UTC')->format('Y-m-d')); + $this->assertEquals('2012-01-31', $parser->getDateTime('01.31.2012')->format('Y-m-d')); + $this->assertEquals('2012-01-31', $parser->getDateTime('01/31/2012')->format('Y-m-d')); + $this->assertEquals('2012-01-31', $parser->getDateTime('2012-01-31')->format('Y-m-d')); + $this->assertEquals('2010-02-24', $parser->getDateTime('2010-02-245T15:27:52Z')->format('Y-m-d')); + $this->assertEquals('2010-08-20', $parser->getDateTime('2010-08-20Thh:08:ssZ')->format('Y-m-d')); + $this->assertEquals(1288648057, $parser->getDateTime('Mon, 01 Nov 2010 21:47:37 UT')->getTimestamp(), '', 1); + $this->assertEquals(1346069615, $parser->getDateTime('Mon Aug 27 2012 12:13:35 GMT-0700 (PDT)')->getTimestamp(), '', 1); + $this->assertEquals($parser->getCurrentDateTime(), $parser->getDateTime('Tue, 3 Febuary 2010 00:00:00 IST')); + $this->assertEquals($parser->getCurrentDateTime(), $parser->getDateTime('############# EST')); + $this->assertEquals($parser->getCurrentDateTime(), $parser->getDateTime('Wed, 30 Nov -0001 00:00:00 +0000')); + $this->assertEquals($parser->getCurrentDateTime(), $parser->getDateTime('čet, 24 maj 2012 00:00:00')); + $this->assertEquals($parser->getCurrentDateTime(), $parser->getDateTime('-0-0T::Z')); + $this->assertEquals($parser->getCurrentDateTime(), $parser->getDateTime('Wed, 18 2012')); + $this->assertEquals($parser->getCurrentDateTime(), $parser->getDateTime("'2009-09-30 CDT16:09:54")); + $this->assertEquals($parser->getCurrentDateTime(), $parser->getDateTime('ary 8 Jan 2013 00:00:00 GMT')); + $this->assertEquals($parser->getCurrentDateTime(), $parser->getDateTime('Sat, 11 00:00:01 GMT')); + $this->assertEquals(1370631743, $parser->getDateTime('Fri Jun 07 2013 19:02:23 GMT+0000 (UTC)')->getTimestamp(), '', 1); + $this->assertEquals(1377412225, $parser->getDateTime('25/08/2013 06:30:25 م')->getTimestamp(), '', 1); + $this->assertEquals($parser->getCurrentDateTime(), $parser->getDateTime('+0400')); } } |