PageRenderTime 59ms CodeModel.GetById 22ms RepoModel.GetById 0ms app.codeStats 1ms

/tests/Zend/Date/DateTest.php

https://github.com/Knekkebjoern/zf2
PHP | 5695 lines | 5408 code | 119 blank | 168 comment | 9 complexity | aa9b829ef97778bfc3ddec0837e5d3b1 MD5 | raw file
Possible License(s): BSD-3-Clause

Large files files are truncated, but you can click here to view the full file

  1. <?php
  2. /**
  3. * Zend Framework
  4. *
  5. * LICENSE
  6. *
  7. * This source file is subject to the new BSD license that is bundled
  8. * with this package in the file LICENSE.txt.
  9. * It is also available through the world-wide-web at this URL:
  10. * http://framework.zend.com/license/new-bsd
  11. * If you did not receive a copy of the license and are unable to
  12. * obtain it through the world-wide-web, please send an email
  13. * to license@zend.com so we can send you a copy immediately.
  14. *
  15. * @category Zend
  16. * @package Zend_Date
  17. * @subpackage UnitTests
  18. * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
  19. * @license http://framework.zend.com/license/new-bsd New BSD License
  20. */
  21. namespace ZendTest\Date;
  22. use Zend\Cache\StorageFactory as CacheFactory,
  23. Zend\Cache\Storage\Adapter\AdapterInterface as CacheAdapter,
  24. Zend\Date\Date,
  25. Zend\Date\Cities,
  26. Zend\Locale\Locale,
  27. Zend\Locale\Exception\ExceptionInterface as LocaleException,
  28. Zend\TimeSync\TimeSync,
  29. Zend\Registry;
  30. /**
  31. * These const values control some testing behavior.
  32. * They may be defined here or in TestConfiguration.php.
  33. */
  34. if (!defined('TESTS_ZEND_LOCALE_BCMATH_ENABLED')) {
  35. // Set to false to disable usage of bcmath extension by Zend_Date
  36. define('TESTS_ZEND_LOCALE_BCMATH_ENABLED', true);
  37. }
  38. if (!defined('TESTS_ZEND_I18N_EXTENDED_COVERAGE')) {
  39. // Set to true to run full Zend_Date unit tests.
  40. // Set to false to run a good subset of Zend_Date unit tests.
  41. define('TESTS_ZEND_I18N_EXTENDED_COVERAGE', true);
  42. }
  43. /**
  44. * @category Zend
  45. * @package Zend_Date
  46. * @subpackage UnitTests
  47. * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
  48. * @license http://framework.zend.com/license/new-bsd New BSD License
  49. * @group Zend_Date
  50. */
  51. class DateTest extends \PHPUnit_Framework_TestCase
  52. {
  53. private $_cache = null;
  54. private $_orig = array();
  55. /**
  56. * Stores the original set timezone
  57. * @var string
  58. */
  59. private $_originaltimezone;
  60. public function setUp()
  61. {
  62. $this->_originaltimezone = date_default_timezone_get();
  63. date_default_timezone_set('Indian/Maldives');
  64. $this->_orig = Date::setOptions();
  65. $this->_cache = CacheFactory::adapterFactory('memory', array('memory_limit' => 0));
  66. Date::setOptions(array('cache' => $this->_cache));
  67. Date::setOptions(array('fix_dst' => true));
  68. Date::setOptions(array('extend_month' => false));
  69. Date::setOptions(array('format_type' => 'iso'));
  70. }
  71. public function tearDown()
  72. {
  73. Date::setOptions($this->_orig);
  74. $this->_cache->clear(CacheAdapter::MATCH_ALL);
  75. date_default_timezone_set($this->_originaltimezone);
  76. }
  77. /**
  78. * Test for date object creation
  79. */
  80. public function testCreation()
  81. {
  82. // look if locale is detectable
  83. try {
  84. $locale = new Locale();
  85. } catch (LocaleException $e) {
  86. $this->markTestSkipped('Autodetection of locale failed');
  87. return;
  88. }
  89. $date = new Date(0);
  90. $this->assertTrue($date instanceof Date);
  91. }
  92. /**
  93. * Test for date object creation using default format for a locale
  94. */
  95. public function testCreationDefaultFormat()
  96. {
  97. // look if locale is detectable
  98. try {
  99. $locale = new Locale();
  100. } catch (LocaleException $e) {
  101. $this->markTestSkipped('Autodetection of locale failed');
  102. return;
  103. }
  104. $date = new Date('2006-01-01');
  105. $this->assertTrue($date instanceof Date);
  106. $this->assertSame('2006-01-01T00:00:00+05:00', $date->get(Date::ISO_8601));
  107. $date = new Date('2006-01-01', 'en_US');
  108. $this->assertTrue($date instanceof Date);
  109. $this->assertSame('2006-01-01T00:00:00+05:00', $date->get(Date::ISO_8601));
  110. }
  111. /**
  112. * Test for date object creation using default format for a locale
  113. */
  114. public function testCreationDefaultFormatConsistency()
  115. {
  116. // look if locale is detectable
  117. try {
  118. $locale = new Locale();
  119. } catch (LocaleException $e) {
  120. $this->markTestSkipped('Autodetection of locale failed');
  121. return;
  122. }
  123. date_default_timezone_set('America/New_York');
  124. $locale = 'en_US';
  125. //2006-01-01T00:00:00+05:00
  126. $date1 = new Date('2006-01-01 01:00:00', Date::ISO_8601, $locale);
  127. $date1string = $date1->get(Date::ISO_8601);
  128. // en_US defines AM/PM, hour 0 does not exist
  129. // ISO defines dates without AM, 0 exists instead of 12 PM
  130. // therefor hour is set to 1 to verify
  131. $date2 = new Date('2006-01-01', Date::DATES, $locale);
  132. $date2->setTime('01:00:00');
  133. $this->assertSame($date1string, $date2->get(Date::ISO_8601));
  134. $date2 = new Date('01-01-2006', Date::DATES, $locale);
  135. $date2->setTime('01:00:00');
  136. $this->assertSame($date1string, $date2->get(Date::ISO_8601));
  137. $date2 = new Date('2006-01-01', null, $locale);
  138. $date2->setTime('01:00:00');
  139. $this->assertSame($date1string, $date2->get(Date::ISO_8601));
  140. $date2 = new Date('2006-01-01');
  141. $date2->setTime('01:00:00');
  142. $this->assertSame($date1string, $date2->get(Date::ISO_8601));
  143. $date2 = new Date('2006-01-01 01:00:00');
  144. $this->assertSame($date1string, $date2->get(Date::ISO_8601));
  145. }
  146. /**
  147. * Test for creation with timestamp
  148. */
  149. public function testCreationTimestamp()
  150. {
  151. // look if locale is detectable
  152. try {
  153. $locale = new Locale();
  154. } catch (LocaleException $e) {
  155. $this->markTestSkipped('Autodetection of locale failed');
  156. return;
  157. }
  158. $date = new Date('12345678');
  159. $this->assertTrue($date instanceof Date);
  160. }
  161. /**
  162. * Test for creation but only part of date
  163. */
  164. public function testCreationDatePart()
  165. {
  166. // look if locale is detectable
  167. try {
  168. $locale = new Locale();
  169. } catch (LocaleException $e) {
  170. $this->markTestSkipped('Autodetection of locale failed');
  171. return;
  172. }
  173. $date = new Date('13',Date::HOUR);
  174. $this->assertTrue($date instanceof Date);
  175. $date = new Date('20070802', 'YYYYMMdd');
  176. $this->assertSame("2007-08-02T00:00:00+05:00", $date->getIso());
  177. }
  178. /**
  179. * Test for creation but only a defined locale
  180. */
  181. public function testCreationLocale()
  182. {
  183. $locale = new Locale('de_AT');
  184. $date = new Date('13',null,$locale);
  185. $this->assertTrue($date instanceof Date);
  186. }
  187. /**
  188. * Test for creation but only part of date with locale
  189. */
  190. public function testCreationLocalePart()
  191. {
  192. $locale = new Locale('de_AT');
  193. $date = new Date('13',Date::HOUR,$locale);
  194. $this->assertTrue($date instanceof Date);
  195. }
  196. /**
  197. * Test for date object creation using default format for a locale
  198. */
  199. public function testCreationDefaultLoose()
  200. {
  201. // look if locale is detectable
  202. try {
  203. $locale = new Locale();
  204. } catch (LocaleException $e) {
  205. $this->markTestSkipped('Autodetection of locale failed');
  206. return;
  207. }
  208. $locale = 'de_AT';
  209. $date = new Date();
  210. $date = $date->getTimestamp();
  211. $this->assertTrue(abs($date - time()) < 2);
  212. date_default_timezone_set('GMT');
  213. $date = new Date(Date::YEAR);
  214. $date = $date->getTimestamp();
  215. $reference = gmmktime(0,0,0,1,1,date('Y'));
  216. $this->assertTrue($reference == $date);
  217. $date = new Date('ar_EG');
  218. $this->assertSame('ar_EG', $date->getLocale());
  219. $date = $date->getTimestamp();
  220. $this->assertTrue(abs($date - time()) < 2);
  221. }
  222. /**
  223. * Test for getTimestamp
  224. */
  225. public function testGetTimestamp()
  226. {
  227. $locale = new Locale('de_AT');
  228. $date = new Date(10000000);
  229. $this->assertSame(10000000, $date->getTimestamp());
  230. }
  231. /**
  232. * Test for getUnixTimestamp
  233. */
  234. public function testgetUnixTimestamp2()
  235. {
  236. $locale = new Locale('de_AT');
  237. $date = new Date(-100000000);
  238. $this->assertSame(-100000000, $date->getTimestamp());
  239. }
  240. /**
  241. * Test for setTimestamp
  242. */
  243. public function testSetTimestamp()
  244. {
  245. $locale = new Locale('de_AT');
  246. $date = new Date(0,Date::TIMESTAMP,$locale);
  247. $result = $date->setTimestamp(10000000);
  248. $this->assertSame('10000000', (string)$result->getTimestamp());
  249. }
  250. /**
  251. * Test for setTimestamp
  252. */
  253. public function testSetTimestamp2()
  254. {
  255. try {
  256. $locale = new Locale('de_AT');
  257. $date = new Date(0,null,$locale);
  258. $result = $date->setTimestamp('notimestamp');
  259. $this->Fail("exception expected");
  260. } catch (\Zend\Date\Exception\ExceptionInterface $e) {
  261. // success
  262. }
  263. }
  264. /**
  265. * Test for addTimestamp
  266. */
  267. public function testAddTimestamp()
  268. {
  269. $locale = new Locale('de_AT');
  270. $date = new Date(0,null,$locale);
  271. $result = $date->addTimestamp(10000000);
  272. $this->assertSame('10000000', (string)$result->getTimestamp());
  273. $result = $date->addTimestamp(array('timestamp' => 1000));
  274. $this->assertSame('10001000', (string)$result->getTimestamp());
  275. try {
  276. $result = $date->addTimestamp(array('notimestamp' => 1000));
  277. $this->fail("exception expected");
  278. } catch (\Zend\Date\Exception\ExceptionInterface $e) {
  279. // success
  280. }
  281. }
  282. /**
  283. * Test for addTimestamp
  284. */
  285. public function testAddTimestamp2()
  286. {
  287. try {
  288. $locale = new Locale('de_AT');
  289. $date = new Date(0,null,$locale);
  290. $result = $date->addTimestamp('notimestamp');
  291. $this->fail("exception expected");
  292. } catch (\Zend\Date\Exception\ExceptionInterface $e) {
  293. // success
  294. }
  295. }
  296. /**
  297. * Test for subTimestamp
  298. */
  299. public function testSubTimestamp()
  300. {
  301. $locale = new Locale('de_AT');
  302. $date = new Date(0,null,$locale);
  303. $result = $date->subTimestamp(10000000);
  304. $this->assertSame('-10000000', (string)$result->getTimestamp());
  305. }
  306. /**
  307. * Test for subTimestamp
  308. */
  309. public function testSubTimestamp2()
  310. {
  311. try {
  312. $locale = new Locale('de_AT');
  313. $date = new Date(0,null,$locale);
  314. $result = $date->subTimestamp('notimestamp');
  315. $this->fail("exception expected");
  316. } catch (\Zend\Date\Exception\ExceptionInterface $e) {
  317. // success
  318. }
  319. }
  320. /**
  321. * Test for compareTimestamp
  322. */
  323. public function testCompareTimestamp()
  324. {
  325. $locale = new Locale('de_AT');
  326. $date1 = new Date(0,null,$locale);
  327. $date2 = new Date(0,null,$locale);
  328. $this->assertSame(0, $date1->compareTimestamp($date2));
  329. $date2 = new Date(100,null,$locale);
  330. $this->assertSame(-1, $date1->compareTimestamp($date2));
  331. $date2 = new Date(-100,null,$locale);
  332. $this->assertSame(1, $date1->compareTimestamp($date2));
  333. }
  334. /**
  335. * Test for __toString
  336. */
  337. public function test_ToString()
  338. {
  339. $locale = new Locale('de_AT');
  340. $date = new Date(0,null,$locale);
  341. $date->setTimezone(date_default_timezone_get());
  342. $this->assertSame('01.01.1970 05:00:00', $date->__toString());
  343. }
  344. /**
  345. * Test for toString
  346. */
  347. public function testToString()
  348. {
  349. $locale = new Locale('de_AT');
  350. $date = new Date(1234567890,null,$locale);
  351. $date->setTimezone(date_default_timezone_get());
  352. $this->assertSame('14.02.2009 04:31:30', $date->toString( ));
  353. $this->assertSame('Feb 14, 2009 4:31:30 AM', $date->toString('en_US' ));
  354. $this->assertSame('Feb 14, 2009 4:31:30 AM', $date->toString(null, 'en_US'));
  355. $this->assertSame('2009', $date->toString('yyy', null ));
  356. $this->assertSame('14.02.2009 04:31:30', $date->toString(null, null ));
  357. $date->setTimeZone('UTC');
  358. $this->assertSame('Feb 13, 2009 11:31:30 PM', $date->toString(null, 'en_US'));
  359. $date->setTimeZone('Indian/Maldives');
  360. $this->assertSame( "xxyy'yyxx", $date->toString("xx'yy''yy'xx"));
  361. $this->assertSame( 'n.', $date->toString("GGGGG"));
  362. $this->assertSame( 'n. Chr.', $date->toString( "GGGG"));
  363. $this->assertSame( 'n. Chr.', $date->toString( "GGG"));
  364. $this->assertSame( 'n. Chr.', $date->toString( "GG"));
  365. $this->assertSame( 'n. Chr.', $date->toString( "G"));
  366. $this->assertSame( '02009', $date->toString("yyyyy"));
  367. $this->assertSame( '2009', $date->toString( "yyyy"));
  368. $this->assertSame( '2009', $date->toString( "yyy"));
  369. $this->assertSame( '09', $date->toString( "yy"));
  370. $this->assertSame( '2009', $date->toString( "y"));
  371. $this->assertSame( '02009', $date->toString("YYYYY"));
  372. $this->assertSame( '2009', $date->toString( "YYYY"));
  373. $this->assertSame( '2009', $date->toString( "YYY"));
  374. $this->assertSame( '09', $date->toString( "YY"));
  375. $this->assertSame( '2009', $date->toString( "Y"));
  376. $this->assertSame( 'F', $date->toString("MMMMM"));
  377. $this->assertSame( 'Februar', $date->toString( "MMMM"));
  378. $this->assertSame( 'Feb', $date->toString( "MMM"));
  379. $this->assertSame( '02', $date->toString( "MM"));
  380. $this->assertSame( '2', $date->toString( "M"));
  381. $this->assertSame( '07', $date->toString( "ww"));
  382. $this->assertSame( '7', $date->toString( "w"));
  383. $this->assertSame( '14', $date->toString( "dd"));
  384. $this->assertSame( '14', $date->toString( "d"));
  385. $this->assertSame( '044', $date->toString( "DDD"));
  386. $this->assertSame( '44', $date->toString( "DD"));
  387. $this->assertSame( '44', $date->toString( "D"));
  388. $this->assertSame( 'S', $date->toString("EEEEE"));
  389. $this->assertSame( 'Samstag', $date->toString( "EEEE"));
  390. $this->assertSame( 'Sam', $date->toString( "EEE"));
  391. $this->assertSame( 'Sa.', $date->toString( "EE"));
  392. $this->assertSame( 'S', $date->toString( "E"));
  393. $this->assertSame( '06', $date->toString( "ee"));
  394. $this->assertSame( '6', $date->toString( "e"));
  395. $this->assertSame( 'vorm.', $date->toString( "a"));
  396. $this->assertSame( '04', $date->toString( "hh"));
  397. $this->assertSame( '4', $date->toString( "h"));
  398. $this->assertSame( '04', $date->toString( "HH"));
  399. $this->assertSame( '4', $date->toString( "H"));
  400. $this->assertSame( '31', $date->toString( "mm"));
  401. $this->assertSame( '31', $date->toString( "m"));
  402. $this->assertSame( '30', $date->toString( "ss"));
  403. $this->assertSame( '30', $date->toString( "s"));
  404. $this->assertSame( '0', $date->toString( "S"));
  405. $this->assertSame('Indian/Maldives', $date->toString( "zzzz"));
  406. $this->assertSame( 'MVT', $date->toString( "zzz"));
  407. $this->assertSame( 'MVT', $date->toString( "zz"));
  408. $this->assertSame( 'MVT', $date->toString( "z"));
  409. $this->assertSame( '+05:00', $date->toString( "ZZZZ"));
  410. $this->assertSame( '+0500', $date->toString( "ZZZ"));
  411. $this->assertSame( '+0500', $date->toString( "ZZ"));
  412. $this->assertSame( '+0500', $date->toString( "Z"));
  413. $this->assertSame( '16290000', $date->toString("AAAAA"));
  414. $this->assertSame( '16290000', $date->toString( "AAAA"));
  415. $this->assertSame( '16290000', $date->toString( "AAA"));
  416. $this->assertSame( '16290000', $date->toString( "AA"));
  417. $this->assertSame( '16290000', $date->toString( "A"));
  418. $date = new Date("1-1-01",null,$locale);
  419. $date->setTimezone(date_default_timezone_get());
  420. $this->assertSame('01', $date->toString("yy"));
  421. }
  422. /**
  423. * Test for toValue
  424. */
  425. public function testToValue()
  426. {
  427. $locale = new Locale('de_AT');
  428. $date = new Date(1234567890,null,$locale);
  429. $date->setTimezone(date_default_timezone_get());
  430. $this->assertSame(1234567890, $date->toValue() );
  431. $this->assertSame( 14, $date->toValue(Date::DAY));
  432. $date->setTimezone('UTC');
  433. $this->assertSame( 13, $date->toValue(Date::DAY ));
  434. $this->assertFalse( $date->toValue(Date::WEEKDAY_SHORT ));
  435. $this->assertSame( 13, $date->toValue(Date::DAY_SHORT ));
  436. $this->assertFalse( $date->toValue(Date::WEEKDAY ));
  437. $this->assertSame( 5, $date->toValue(Date::WEEKDAY_8601 ));
  438. $this->assertFalse( $date->toValue(Date::DAY_SUFFIX ));
  439. $this->assertSame( 5, $date->toValue(Date::WEEKDAY_DIGIT ));
  440. $this->assertSame( 43, $date->toValue(Date::DAY_OF_YEAR ));
  441. $this->assertFalse( $date->toValue(Date::WEEKDAY_NARROW ));
  442. $this->assertFalse( $date->toValue(Date::WEEKDAY_NAME ));
  443. $this->assertSame( 7, $date->toValue(Date::WEEK ));
  444. $this->assertFalse( $date->toValue(Date::MONTH_NAME ));
  445. $this->assertSame( 2, $date->toValue(Date::MONTH ));
  446. $this->assertFalse( $date->toValue(Date::MONTH_NAME_SHORT ));
  447. $this->assertSame( 2, $date->toValue(Date::MONTH_SHORT ));
  448. $this->assertSame( 28, $date->toValue(Date::MONTH_DAYS ));
  449. $this->assertFalse( $date->toValue(Date::MONTH_NAME_NARROW));
  450. $this->assertSame( 0, $date->toValue(Date::LEAPYEAR ));
  451. $this->assertSame( 2009, $date->toValue(Date::YEAR_8601 ));
  452. $this->assertSame( 2009, $date->toValue(Date::YEAR ));
  453. $this->assertSame( 9, $date->toValue(Date::YEAR_SHORT ));
  454. $this->assertSame( 9, $date->toValue(Date::YEAR_SHORT_8601 ));
  455. $this->assertFalse( $date->toValue(Date::MERIDIEM ));
  456. $this->assertSame( 21, $date->toValue(Date::SWATCH ));
  457. $this->assertSame( 11, $date->toValue(Date::HOUR_SHORT_AM ));
  458. $this->assertSame( 23, $date->toValue(Date::HOUR_SHORT ));
  459. $this->assertSame( 11, $date->toValue(Date::HOUR_AM ));
  460. $this->assertSame( 23, $date->toValue(Date::HOUR ));
  461. $this->assertSame( 31, $date->toValue(Date::MINUTE ));
  462. $this->assertSame( 30, $date->toValue(Date::SECOND ));
  463. $this->assertSame( 0, $date->toValue(Date::MILLISECOND ));
  464. $this->assertSame( 31, $date->toValue(Date::MINUTE_SHORT ));
  465. $this->assertSame( 30, $date->toValue(Date::SECOND_SHORT ));
  466. $this->assertFalse( $date->toValue(Date::TIMEZONE_NAME ));
  467. $this->assertSame( 0, $date->toValue(Date::DAYLIGHT ));
  468. $this->assertSame( 0, $date->toValue(Date::GMT_DIFF ));
  469. $this->assertFalse( $date->toValue(Date::GMT_DIFF_SEP ));
  470. $this->assertFalse( $date->toValue(Date::TIMEZONE ));
  471. $this->assertSame( 0, $date->toValue(Date::TIMEZONE_SECS ));
  472. $this->assertFalse( $date->toValue(Date::ISO_8601 ));
  473. $this->assertFalse( $date->toValue(Date::RFC_2822 ));
  474. $this->assertSame(1234567890, $date->toValue(Date::TIMESTAMP ));
  475. $this->assertFalse( $date->toValue(Date::ERA ));
  476. $this->assertFalse( $date->toValue(Date::ERA_NAME ));
  477. $this->assertFalse( $date->toValue(Date::DATES ));
  478. $this->assertFalse( $date->toValue(Date::DATE_FULL ));
  479. $this->assertFalse( $date->toValue(Date::DATE_LONG ));
  480. $this->assertFalse( $date->toValue(Date::DATE_MEDIUM ));
  481. $this->assertFalse( $date->toValue(Date::DATE_SHORT ));
  482. $this->assertFalse( $date->toValue(Date::TIMES ));
  483. $this->assertFalse( $date->toValue(Date::TIME_FULL ));
  484. $this->assertFalse( $date->toValue(Date::TIME_LONG ));
  485. $this->assertFalse( $date->toValue(Date::TIME_MEDIUM ));
  486. $this->assertFalse( $date->toValue(Date::TIME_SHORT ));
  487. $this->assertFalse( $date->toValue(Date::DATETIME ));
  488. $this->assertFalse( $date->toValue(Date::DATETIME_FULL ));
  489. $this->assertFalse( $date->toValue(Date::DATETIME_LONG ));
  490. $this->assertFalse( $date->toValue(Date::DATETIME_MEDIUM ));
  491. $this->assertFalse( $date->toValue(Date::DATETIME_SHORT ));
  492. $this->assertFalse( $date->toValue(Date::ATOM ));
  493. $this->assertFalse( $date->toValue(Date::COOKIE ));
  494. $this->assertFalse( $date->toValue(Date::RFC_822 ));
  495. $this->assertFalse( $date->toValue(Date::RFC_850 ));
  496. $this->assertFalse( $date->toValue(Date::RFC_1036 ));
  497. $this->assertFalse( $date->toValue(Date::RFC_1123 ));
  498. $this->assertFalse( $date->toValue(Date::RFC_3339 ));
  499. $this->assertFalse( $date->toValue(Date::RSS ));
  500. $this->assertFalse( $date->toValue(Date::W3C ));
  501. $date->setTimezone('Indian/Maldives');
  502. $this->assertFalse( $date->toValue(Date::WEEKDAY_SHORT ));
  503. $this->assertSame( 14, $date->toValue(Date::DAY_SHORT ));
  504. $this->assertFalse( $date->toValue(Date::WEEKDAY ));
  505. $this->assertSame( 6, $date->toValue(Date::WEEKDAY_8601 ));
  506. $this->assertFalse( $date->toValue(Date::DAY_SUFFIX ));
  507. $this->assertSame( 6, $date->toValue(Date::WEEKDAY_DIGIT ));
  508. $this->assertSame( 44, $date->toValue(Date::DAY_OF_YEAR ));
  509. $this->assertFalse( $date->toValue(Date::WEEKDAY_NARROW ));
  510. $this->assertFalse( $date->toValue(Date::WEEKDAY_NAME ));
  511. $this->assertSame( 7, $date->toValue(Date::WEEK ));
  512. $this->assertFalse( $date->toValue(Date::MONTH_NAME ));
  513. $this->assertSame( 2, $date->toValue(Date::MONTH ));
  514. $this->assertFalse( $date->toValue(Date::MONTH_NAME_SHORT ));
  515. $this->assertSame( 2, $date->toValue(Date::MONTH_SHORT ));
  516. $this->assertSame( 28, $date->toValue(Date::MONTH_DAYS ));
  517. $this->assertFalse( $date->toValue(Date::MONTH_NAME_NARROW));
  518. $this->assertSame( 0, $date->toValue(Date::LEAPYEAR ));
  519. $this->assertSame( 2009, $date->toValue(Date::YEAR_8601 ));
  520. $this->assertSame( 2009, $date->toValue(Date::YEAR ));
  521. $this->assertSame( 9, $date->toValue(Date::YEAR_SHORT ));
  522. $this->assertSame( 9, $date->toValue(Date::YEAR_SHORT_8601 ));
  523. $this->assertFalse( $date->toValue(Date::MERIDIEM ));
  524. $this->assertSame( 21, $date->toValue(Date::SWATCH ));
  525. $this->assertSame( 4, $date->toValue(Date::HOUR_SHORT_AM ));
  526. $this->assertSame( 4, $date->toValue(Date::HOUR_SHORT ));
  527. $this->assertSame( 4, $date->toValue(Date::HOUR_AM ));
  528. $this->assertSame( 4, $date->toValue(Date::HOUR ));
  529. $this->assertSame( 31, $date->toValue(Date::MINUTE ));
  530. $this->assertSame( 30, $date->toValue(Date::SECOND ));
  531. $this->assertSame( 0, $date->toValue(Date::MILLISECOND ));
  532. $this->assertSame( 31, $date->toValue(Date::MINUTE_SHORT ));
  533. $this->assertSame( 30, $date->toValue(Date::SECOND_SHORT ));
  534. $this->assertFalse( $date->toValue(Date::TIMEZONE_NAME ));
  535. $this->assertSame( 0, $date->toValue(Date::DAYLIGHT ));
  536. $this->assertSame( 500, $date->toValue(Date::GMT_DIFF ));
  537. $this->assertFalse( $date->toValue(Date::GMT_DIFF_SEP ));
  538. $this->assertFalse( $date->toValue(Date::TIMEZONE ));
  539. $this->assertSame( 18000, $date->toValue(Date::TIMEZONE_SECS ));
  540. $this->assertFalse( $date->toValue(Date::ISO_8601 ));
  541. $this->assertFalse( $date->toValue(Date::RFC_2822 ));
  542. $this->assertSame(1234567890, $date->toValue(Date::TIMESTAMP ));
  543. $this->assertFalse( $date->toValue(Date::ERA ));
  544. $this->assertFalse( $date->toValue(Date::ERA_NAME ));
  545. $this->assertFalse( $date->toValue(Date::DATES ));
  546. $this->assertFalse( $date->toValue(Date::DATE_FULL ));
  547. $this->assertFalse( $date->toValue(Date::DATE_LONG ));
  548. $this->assertFalse( $date->toValue(Date::DATE_MEDIUM ));
  549. $this->assertFalse( $date->toValue(Date::DATE_SHORT ));
  550. $this->assertFalse( $date->toValue(Date::TIMES ));
  551. $this->assertFalse( $date->toValue(Date::TIME_FULL ));
  552. $this->assertFalse( $date->toValue(Date::TIME_LONG ));
  553. $this->assertFalse( $date->toValue(Date::TIME_MEDIUM ));
  554. $this->assertFalse( $date->toValue(Date::TIME_SHORT ));
  555. $this->assertFalse( $date->toValue(Date::DATETIME ));
  556. $this->assertFalse( $date->toValue(Date::DATETIME_FULL ));
  557. $this->assertFalse( $date->toValue(Date::DATETIME_LONG ));
  558. $this->assertFalse( $date->toValue(Date::DATETIME_MEDIUM ));
  559. $this->assertFalse( $date->toValue(Date::DATETIME_SHORT ));
  560. $this->assertFalse( $date->toValue(Date::ATOM ));
  561. $this->assertFalse( $date->toValue(Date::COOKIE ));
  562. $this->assertFalse( $date->toValue(Date::RFC_822 ));
  563. $this->assertFalse( $date->toValue(Date::RFC_850 ));
  564. $this->assertFalse( $date->toValue(Date::RFC_1036 ));
  565. $this->assertFalse( $date->toValue(Date::RFC_1123 ));
  566. $this->assertFalse( $date->toValue(Date::RFC_3339 ));
  567. $this->assertFalse( $date->toValue(Date::RSS ));
  568. $this->assertFalse( $date->toValue(Date::W3C ));
  569. }
  570. /**
  571. * Test for toValue
  572. */
  573. public function testGet()
  574. {
  575. $locale = new Locale('de_AT');
  576. $date = new Date(1234567890,null,$locale);
  577. $date->setTimezone('UTC');
  578. $this->assertSame( '13', $date->get(Date::DAY ));
  579. $this->assertSame( 'Fre', $date->get(Date::WEEKDAY_SHORT ));
  580. $this->assertSame( '13', $date->get(Date::DAY_SHORT ));
  581. $this->assertSame( 'Freitag', $date->get(Date::WEEKDAY ));
  582. $this->assertSame( '5', $date->get(Date::WEEKDAY_8601 ));
  583. $this->assertSame( 'th', $date->get(Date::DAY_SUFFIX ));
  584. $this->assertSame( '5', $date->get(Date::WEEKDAY_DIGIT ));
  585. $this->assertSame( '43', $date->get(Date::DAY_OF_YEAR ));
  586. $this->assertSame( 'F', $date->get(Date::WEEKDAY_NARROW ));
  587. $this->assertSame( 'Fr.', $date->get(Date::WEEKDAY_NAME ));
  588. $this->assertSame( '07', $date->get(Date::WEEK ));
  589. $this->assertSame( 'Februar', $date->get(Date::MONTH_NAME ));
  590. $this->assertSame( '02', $date->get(Date::MONTH ));
  591. $this->assertSame( 'Feb', $date->get(Date::MONTH_NAME_SHORT ));
  592. $this->assertSame( '2', $date->get(Date::MONTH_SHORT ));
  593. $this->assertSame( '28', $date->get(Date::MONTH_DAYS ));
  594. $this->assertSame( 'F', $date->get(Date::MONTH_NAME_NARROW));
  595. $this->assertSame( '0', $date->get(Date::LEAPYEAR ));
  596. $this->assertSame( '2009', $date->get(Date::YEAR_8601 ));
  597. $this->assertSame( '2009', $date->get(Date::YEAR ));
  598. $this->assertSame( '09', $date->get(Date::YEAR_SHORT ));
  599. $this->assertSame( '09', $date->get(Date::YEAR_SHORT_8601 ));
  600. $this->assertSame( 'nachm.', $date->get(Date::MERIDIEM ));
  601. $this->assertSame( '021', $date->get(Date::SWATCH ));
  602. $this->assertSame( '11', $date->get(Date::HOUR_SHORT_AM ));
  603. $this->assertSame( '23', $date->get(Date::HOUR_SHORT ));
  604. $this->assertSame( '11', $date->get(Date::HOUR_AM ));
  605. $this->assertSame( '23', $date->get(Date::HOUR ));
  606. $this->assertSame( '31', $date->get(Date::MINUTE ));
  607. $this->assertSame( '30', $date->get(Date::SECOND ));
  608. $this->assertSame( '0', $date->get(Date::MILLISECOND ));
  609. $this->assertSame( '31', $date->get(Date::MINUTE_SHORT ));
  610. $this->assertSame( '30', $date->get(Date::SECOND_SHORT ));
  611. $this->assertSame( 'UTC', $date->get(Date::TIMEZONE_NAME ));
  612. $this->assertSame( '0', $date->get(Date::DAYLIGHT ));
  613. $this->assertSame( '+0000', $date->get(Date::GMT_DIFF ));
  614. $this->assertSame( '+00:00', $date->get(Date::GMT_DIFF_SEP ));
  615. $this->assertSame( 'UTC', $date->get(Date::TIMEZONE ));
  616. $this->assertSame( '0', $date->get(Date::TIMEZONE_SECS ));
  617. $this->assertSame( '2009-02-13T23:31:30+00:00', $date->get(Date::ISO_8601 ));
  618. $this->assertSame('Fri, 13 Feb 2009 23:31:30 +0000', $date->get(Date::RFC_2822 ));
  619. $this->assertSame( '1234567890', $date->get(Date::TIMESTAMP ));
  620. $this->assertSame( 'n. Chr.', $date->get(Date::ERA ));
  621. $this->assertSame( 'n. Chr.', $date->get(Date::ERA_NAME ));
  622. $this->assertSame( '13.02.2009', $date->get(Date::DATES ));
  623. $this->assertSame( 'Freitag, 13. Februar 2009', $date->get(Date::DATE_FULL ));
  624. $this->assertSame( '13. Februar 2009', $date->get(Date::DATE_LONG ));
  625. $this->assertSame( '13.02.2009', $date->get(Date::DATE_MEDIUM ));
  626. $this->assertSame( '13.02.09', $date->get(Date::DATE_SHORT ));
  627. $this->assertSame( '23:31:30', $date->get(Date::TIMES ));
  628. $this->assertSame( '23:31:30 UTC', $date->get(Date::TIME_FULL ));
  629. $this->assertSame( '23:31:30 UTC', $date->get(Date::TIME_LONG ));
  630. $this->assertSame( '23:31:30', $date->get(Date::TIME_MEDIUM ));
  631. $this->assertSame( '23:31', $date->get(Date::TIME_SHORT ));
  632. $this->assertSame( '13.02.2009 23:31:30', $date->get(Date::DATETIME ));
  633. $this->assertSame('Freitag, 13. Februar 2009 23:31:30 UTC', $date->get(Date::DATETIME_FULL ));
  634. $this->assertSame( '13. Februar 2009 23:31:30 UTC', $date->get(Date::DATETIME_LONG ));
  635. $this->assertSame( '13.02.2009 23:31:30', $date->get(Date::DATETIME_MEDIUM ));
  636. $this->assertSame( '13.02.09 23:31', $date->get(Date::DATETIME_SHORT ));
  637. $this->assertSame( '2009-02-13T23:31:30+00:00', $date->get(Date::ATOM ));
  638. $this->assertSame( 'Friday, 13-Feb-09 23:31:30 UTC', $date->get(Date::COOKIE ));
  639. $this->assertSame( 'Fri, 13 Feb 09 23:31:30 +0000', $date->get(Date::RFC_822 ));
  640. $this->assertSame( 'Friday, 13-Feb-09 23:31:30 UTC', $date->get(Date::RFC_850 ));
  641. $this->assertSame( 'Fri, 13 Feb 09 23:31:30 +0000', $date->get(Date::RFC_1036 ));
  642. $this->assertSame('Fri, 13 Feb 2009 23:31:30 +0000', $date->get(Date::RFC_1123 ));
  643. $this->assertSame( '2009-02-13T23:31:30+00:00', $date->get(Date::RFC_3339 ));
  644. $this->assertSame('Fri, 13 Feb 2009 23:31:30 +0000', $date->get(Date::RSS ));
  645. $this->assertSame( '2009-02-13T23:31:30+00:00', $date->get(Date::W3C ));
  646. $this->assertSame( '13', $date->get(Date::DAY, 'es'));
  647. $this->assertSame( 'vie', $date->get(Date::WEEKDAY_SHORT, 'es'));
  648. $this->assertSame( '13', $date->get(Date::DAY_SHORT, 'es'));
  649. $this->assertSame( 'viernes', $date->get(Date::WEEKDAY, 'es'));
  650. $this->assertSame( '5', $date->get(Date::WEEKDAY_8601, 'es'));
  651. $this->assertSame( 'th', $date->get(Date::DAY_SUFFIX, 'es'));
  652. $this->assertSame( '5', $date->get(Date::WEEKDAY_DIGIT, 'es'));
  653. $this->assertSame( '43', $date->get(Date::DAY_OF_YEAR, 'es'));
  654. $this->assertSame( 'v', $date->get(Date::WEEKDAY_NARROW, 'es'));
  655. $this->assertSame( 'vie', $date->get(Date::WEEKDAY_NAME, 'es'));
  656. $this->assertSame( '07', $date->get(Date::WEEK, 'es'));
  657. $this->assertSame( 'febrero', $date->get(Date::MONTH_NAME, 'es'));
  658. $this->assertSame( '02', $date->get(Date::MONTH, 'es'));
  659. $this->assertSame( 'feb', $date->get(Date::MONTH_NAME_SHORT, 'es'));
  660. $this->assertSame( '2', $date->get(Date::MONTH_SHORT, 'es'));
  661. $this->assertSame( '28', $date->get(Date::MONTH_DAYS, 'es'));
  662. $this->assertSame( 'f', $date->get(Date::MONTH_NAME_NARROW, 'es'));
  663. $this->assertSame( '0', $date->get(Date::LEAPYEAR, 'es'));
  664. $this->assertSame( '2009', $date->get(Date::YEAR_8601, 'es'));
  665. $this->assertSame( '2009', $date->get(Date::YEAR, 'es'));
  666. $this->assertSame( '09', $date->get(Date::YEAR_SHORT, 'es'));
  667. $this->assertSame( '09', $date->get(Date::YEAR_SHORT_8601, 'es'));
  668. $this->assertSame( 'p.m.', $date->get(Date::MERIDIEM, 'es'));
  669. $this->assertSame( '021', $date->get(Date::SWATCH, 'es'));
  670. $this->assertSame( '11', $date->get(Date::HOUR_SHORT_AM, 'es'));
  671. $this->assertSame( '23', $date->get(Date::HOUR_SHORT, 'es'));
  672. $this->assertSame( '11', $date->get(Date::HOUR_AM, 'es'));
  673. $this->assertSame( '23', $date->get(Date::HOUR, 'es'));
  674. $this->assertSame( '31', $date->get(Date::MINUTE, 'es'));
  675. $this->assertSame( '30', $date->get(Date::SECOND, 'es'));
  676. $this->assertSame( '0', $date->get(Date::MILLISECOND, 'es'));
  677. $this->assertSame( '31', $date->get(Date::MINUTE_SHORT, 'es'));
  678. $this->assertSame( '30', $date->get(Date::SECOND_SHORT, 'es'));
  679. $this->assertSame( 'UTC', $date->get(Date::TIMEZONE_NAME, 'es'));
  680. $this->assertSame( '0', $date->get(Date::DAYLIGHT, 'es'));
  681. $this->assertSame( '+0000', $date->get(Date::GMT_DIFF, 'es'));
  682. $this->assertSame( '+00:00', $date->get(Date::GMT_DIFF_SEP, 'es'));
  683. $this->assertSame( 'UTC', $date->get(Date::TIMEZONE, 'es'));
  684. $this->assertSame( '0', $date->get(Date::TIMEZONE_SECS, 'es'));
  685. $this->assertSame( '2009-02-13T23:31:30+00:00', $date->get(Date::ISO_8601, 'es'));
  686. $this->assertSame('Fri, 13 Feb 2009 23:31:30 +0000', $date->get(Date::RFC_2822, 'es'));
  687. $this->assertSame( '1234567890', $date->get(Date::TIMESTAMP, 'es'));
  688. $this->assertSame( 'd.C.', $date->get(Date::ERA, 'es'));
  689. $this->assertSame( 'anno Dómini', $date->get(Date::ERA_NAME, 'es'));
  690. $this->assertSame( '13/02/2009', $date->get(Date::DATES, 'es'));
  691. $this->assertSame( 'viernes 13 de febrero de 2009', $date->get(Date::DATE_FULL, 'es'));
  692. $this->assertSame( '13 de febrero de 2009', $date->get(Date::DATE_LONG, 'es'));
  693. $this->assertSame( '13/02/2009', $date->get(Date::DATE_MEDIUM, 'es'));
  694. $this->assertSame( '13/02/09', $date->get(Date::DATE_SHORT, 'es'));
  695. $this->assertSame( '23:31:30', $date->get(Date::TIMES, 'es'));
  696. $this->assertSame( '23:31:30 UTC', $date->get(Date::TIME_FULL, 'es'));
  697. $this->assertSame( '23:31:30 UTC', $date->get(Date::TIME_LONG, 'es'));
  698. $this->assertSame( '23:31:30', $date->get(Date::TIME_MEDIUM, 'es'));
  699. $this->assertSame( '23:31', $date->get(Date::TIME_SHORT, 'es'));
  700. $this->assertSame( '13/02/2009 23:31:30', $date->get(Date::DATETIME, 'es'));
  701. $this->assertSame('viernes 13 de febrero de 2009 23:31:30 UTC', $date->get(Date::DATETIME_FULL, 'es'));
  702. $this->assertSame('13 de febrero de 2009 23:31:30 UTC', $date->get(Date::DATETIME_LONG, 'es'));
  703. $this->assertSame( '13/02/2009 23:31:30', $date->get(Date::DATETIME_MEDIUM, 'es'));
  704. $this->assertSame( '13/02/09 23:31', $date->get(Date::DATETIME_SHORT, 'es'));
  705. $this->assertSame( '2009-02-13T23:31:30+00:00', $date->get(Date::ATOM, 'es'));
  706. $this->assertSame( 'Friday, 13-Feb-09 23:31:30 UTC', $date->get(Date::COOKIE, 'es'));
  707. $this->assertSame( 'Fri, 13 Feb 09 23:31:30 +0000', $date->get(Date::RFC_822, 'es'));
  708. $this->assertSame( 'Friday, 13-Feb-09 23:31:30 UTC', $date->get(Date::RFC_850, 'es'));
  709. $this->assertSame( 'Fri, 13 Feb 09 23:31:30 +0000', $date->get(Date::RFC_1036, 'es'));
  710. $this->assertSame('Fri, 13 Feb 2009 23:31:30 +0000', $date->get(Date::RFC_1123, 'es'));
  711. $this->assertSame( '2009-02-13T23:31:30+00:00', $date->get(Date::RFC_3339, 'es'));
  712. $this->assertSame('Fri, 13 Feb 2009 23:31:30 +0000', $date->get(Date::RSS, 'es'));
  713. $this->assertSame( '2009-02-13T23:31:30+00:00', $date->get(Date::W3C, 'es'));
  714. $date->setTimezone('Indian/Maldives');
  715. $this->assertSame( '1234567890', $date->get( ));
  716. $this->assertSame( '14', $date->get(Date::DAY ));
  717. $this->assertSame( 'Sam', $date->get(Date::WEEKDAY_SHORT ));
  718. $this->assertSame( '14', $date->get(Date::DAY_SHORT ));
  719. $this->assertSame( 'Samstag', $date->get(Date::WEEKDAY ));
  720. $this->assertSame( '6', $date->get(Date::WEEKDAY_8601 ));
  721. $this->assertSame( 'th', $date->get(Date::DAY_SUFFIX ));
  722. $this->assertSame( '6', $date->get(Date::WEEKDAY_DIGIT ));
  723. $this->assertSame( '44', $date->get(Date::DAY_OF_YEAR ));
  724. $this->assertSame( 'S', $date->get(Date::WEEKDAY_NARROW ));
  725. $this->assertSame( 'Sa.', $date->get(Date::WEEKDAY_NAME ));
  726. $this->assertSame( '07', $date->get(Date::WEEK ));
  727. $this->assertSame( 'Februar', $date->get(Date::MONTH_NAME ));
  728. $this->assertSame( '02', $date->get(Date::MONTH ));
  729. $this->assertSame( 'Feb', $date->get(Date::MONTH_NAME_SHORT ));
  730. $this->assertSame( '2', $date->get(Date::MONTH_SHORT ));
  731. $this->assertSame( '28', $date->get(Date::MONTH_DAYS ));
  732. $this->assertSame( 'F', $date->get(Date::MONTH_NAME_NARROW));
  733. $this->assertSame( '0', $date->get(Date::LEAPYEAR ));
  734. $this->assertSame( '2009', $date->get(Date::YEAR_8601 ));
  735. $this->assertSame( '2009', $date->get(Date::YEAR ));
  736. $this->assertSame( '09', $date->get(Date::YEAR_SHORT ));
  737. $this->assertSame( '09', $date->get(Date::YEAR_SHORT_8601 ));
  738. $this->assertSame( 'vorm.', $date->get(Date::MERIDIEM ));
  739. $this->assertSame( '021', $date->get(Date::SWATCH ));
  740. $this->assertSame( '4', $date->get(Date::HOUR_SHORT_AM ));
  741. $this->assertSame( '4', $date->get(Date::HOUR_SHORT ));
  742. $this->assertSame( '04', $date->get(Date::HOUR_AM ));
  743. $this->assertSame( '04', $date->get(Date::HOUR ));
  744. $this->assertSame( '31', $date->get(Date::MINUTE ));
  745. $this->assertSame( '30', $date->get(Date::SECOND ));
  746. $this->assertSame( '0', $date->get(Date::MILLISECOND ));
  747. $this->assertSame( '31', $date->get(Date::MINUTE_SHORT ));
  748. $this->assertSame( '30', $date->get(Date::SECOND_SHORT ));
  749. $this->assertSame( 'Indian/Maldives', $date->get(Date::TIMEZONE_NAME ));
  750. $this->assertSame( '0', $date->get(Date::DAYLIGHT ));
  751. $this->assertSame( '+0500', $date->get(Date::GMT_DIFF ));
  752. $this->assertSame( '+05:00', $date->get(Date::GMT_DIFF_SEP ));
  753. $this->assertSame( 'MVT', $date->get(Date::TIMEZONE ));
  754. $this->assertSame( '18000', $date->get(Date::TIMEZONE_SECS ));
  755. $this->assertSame( '2009-02-14T04:31:30+05:00', $date->get(Date::ISO_8601 ));
  756. $this->assertSame( 'Sat, 14 Feb 2009 04:31:30 +0500', $date->get(Date::RFC_2822 ));
  757. $this->assertSame( '1234567890', $date->get(Date::TIMESTAMP ));
  758. $this->assertSame( 'n. Chr.', $date->get(Date::ERA ));
  759. $this->assertSame( 'n. Chr.', $date->get(Date::ERA_NAME ));
  760. $this->assertSame( '14.02.2009', $date->get(Date::DATES ));
  761. $this->assertSame( 'Samstag, 14. Februar 2009', $date->get(Date::DATE_FULL ));
  762. $this->assertSame( '14. Februar 2009', $date->get(Date::DATE_LONG ));
  763. $this->assertSame( '14.02.2009', $date->get(Date::DATE_MEDIUM ));
  764. $this->assertSame( '14.02.09', $date->get(Date::DATE_SHORT ));
  765. $this->assertSame( '04:31:30', $date->get(Date::TIMES ));
  766. $this->assertSame( '04:31:30 Indian/Maldives', $date->get(Date::TIME_FULL ));
  767. $this->assertSame( '04:31:30 MVT', $date->get(Date::TIME_LONG ));
  768. $this->assertSame( '04:31:30', $date->get(Date::TIME_MEDIUM ));
  769. $this->assertSame( '04:31', $date->get(Date::TIME_SHORT ));
  770. $this->assertSame( '14.02.2009 04:31:30', $date->get(Date::DATETIME ));
  771. $this->assertSame('Samstag, 14. Februar 2009 04:31:30 Indian/Maldives', $date->get(Date::DATETIME_FULL ));
  772. $this->assertSame( '14. Februar 2009 04:31:30 MVT', $date->get(Date::DATETIME_LONG ));
  773. $this->assertSame( '14.02.2009 04:31:30', $date->get(Date::DATETIME_MEDIUM ));
  774. $this->assertSame( '14.02.09 04:31', $date->get(Date::DATETIME_SHORT ));
  775. $this->assertSame( '2009-02-14T04:31:30+05:00', $date->get(Date::ATOM ));
  776. $this->assertSame('Saturday, 14-Feb-09 04:31:30 Indian/Maldives', $date->get(Date::COOKIE ));
  777. $this->assertSame( 'Sat, 14 Feb 09 04:31:30 +0500', $date->get(Date::RFC_822 ));
  778. $this->assertSame('Saturday, 14-Feb-09 04:31:30 Indian/Maldives', $date->get(Date::RFC_850 ));
  779. $this->assertSame( 'Sat, 14 Feb 09 04:31:30 +0500', $date->get(Date::RFC_1036 ));
  780. $this->assertSame( 'Sat, 14 Feb 2009 04:31:30 +0500', $date->get(Date::RFC_1123 ));
  781. $this->assertSame( '2009-02-14T04:31:30+05:00', $date->get(Date::RFC_3339 ));
  782. $this->assertSame( 'Sat, 14 Feb 2009 04:31:30 +0500', $date->get(Date::RSS ));
  783. $this->assertSame( '2009-02-14T04:31:30+05:00'

Large files files are truncated, but you can click here to view the full file