Changeset 1741

Show
Ignore:
Timestamp:
07/28/08 00:15:06 (4 months ago)
Author:
mikey
Message:

extend test coverage

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • framework/trunk/src/test/php/net/stubbles/xml/xsl/util/stubXSLDateFormatterTestCase.php

    r1713 r1741  
    8080 
    8181    /** 
     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    /** 
    8294     * test that given timestamp will be used 
    8395     * 
     
    89101        $this->assertEquals('<?xml version="1.0" encoding="UTF-8"?>' . "\n<date timestamp=\"1216222717\">16 Jul 2008</date>\n", $doc->saveXML()); 
    90102    } 
     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    } 
    91115} 
    92116?>