Changeset 1741
- Timestamp:
- 07/28/08 00:15:06 (4 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
framework/trunk/src/test/php/net/stubbles/xml/xsl/util/stubXSLDateFormatterTestCase.php
r1713 r1741 80 80 81 81 /** 82 * test that current timestamp will be used 83 * 84 * @test 85 */ 86 public function formatDateWithoutTimestamp() 87 { 88 $dateNode = $this->xslDateFormatter->formatDate('Y-m-d')->getElementsByTagName('date')->item(0); 89 $this->assertLessThanOrEqual(time(), $dateNode->attributes->getNamedItem('timestamp')->textContent); 90 $this->assertEquals(date('Y-m-d'), $dateNode->textContent); 91 } 92 93 /** 82 94 * test that given timestamp will be used 83 95 * … … 89 101 $this->assertEquals('<?xml version="1.0" encoding="UTF-8"?>' . "\n<date timestamp=\"1216222717\">16 Jul 2008</date>\n", $doc->saveXML()); 90 102 } 103 104 /** 105 * test that current timestamp will be used 106 * 107 * @test 108 */ 109 public function formatLocaleDateWithoutTimestamp() 110 { 111 $dateNode = $this->xslDateFormatter->formatLocaleDate('%d %b %Y')->getElementsByTagName('date')->item(0); 112 $this->assertLessThanOrEqual(time(), $dateNode->attributes->getNamedItem('timestamp')->textContent); 113 $this->assertEquals(strftime('%d %b %Y'), $dateNode->textContent); 114 } 91 115 } 92 116 ?>
