Changeset 1868
- Timestamp:
- 09/27/08 15:59:57 (3 months ago)
- Files:
-
- framework/trunk/src/main/php/net/stubbles/lang/types/stubDate.php (modified) (2 diffs)
- framework/trunk/src/main/php/net/stubbles/lang/types/stubTimeZone.php (modified) (1 diff)
- framework/trunk/src/test/php/net/stubbles/lang/types/stubDateTestCase.php (modified) (1 diff)
- framework/trunk/src/test/php/net/stubbles/lang/types/stubTimeZoneTestCase.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
framework/trunk/src/main/php/net/stubbles/lang/types/stubDate.php
r1860 r1868 93 93 * returns internal date/time handle 94 94 * 95 * @return DateTime Zone95 * @return DateTime 96 96 */ 97 97 public function getHandle() … … 254 254 255 255 /** 256 * returns a string representation of the class 257 * 258 * @return string 259 */ 260 public function __toString() 261 { 262 return self::getStringRepresentationOf($this, array('dateTime' => $this->format('Y-m-d H:i:sO'))); 263 } 264 265 /** 256 266 * make sure handle is cloned as well 257 267 */ framework/trunk/src/main/php/net/stubbles/lang/types/stubTimeZone.php
r1858 r1868 147 147 return false; 148 148 } 149 150 /** 151 * returns a string representation of the class 152 * 153 * @return string 154 */ 155 public function __toString() 156 { 157 return self::getStringRepresentationOf($this, array('timeZone' => $this->timeZone->getName())); 158 } 149 159 } 150 160 ?> framework/trunk/src/test/php/net/stubbles/lang/types/stubDateTestCase.php
r1860 r1868 424 424 $date = new stubDate('invalid'); 425 425 } 426 427 /** 428 * ensure a readable string representation is created 429 * 430 * @test 431 */ 432 public function toStringConvertsDateTimePropertyIntoReadableDateRepresentation() 433 { 434 $date = new stubDate('31.12.1969 00:00 GMT'); 435 $this->assertEquals("net::stubbles::lang::types::stubDate {\n dateTime(string): 1969-12-31 00:00:00+0000\n}\n", (string) $date); 436 } 426 437 } 427 438 ?> framework/trunk/src/test/php/net/stubbles/lang/types/stubTimeZoneTestCase.php
r1858 r1868 156 156 $timeZone = new stubTimeZone('Europe/Karlsruhe'); 157 157 } 158 159 /** 160 * time zone instance can be transformed into a readable representation 161 * 162 * @test 163 */ 164 public function toStringConversionCreatesReadableRepresentation() 165 { 166 $this->assertEquals("net::stubbles::lang::types::stubTimeZone {\n timeZone(string): Europe/Berlin\n}\n", (string) $this->timeZone); 167 } 158 168 } 159 169 ?>
