Skip to content

Commit

Permalink
Add DateTimeTest
Browse files Browse the repository at this point in the history
  • Loading branch information
c9s committed Feb 8, 2015
1 parent d0eb5c1 commit eae49fd
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/LazyRecord/Types/DateTime.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
namespace LazyRecord\Types;
use DateTime as PHPDateTime;

/**
* Extended DateTime class from PHP built-in DateTime
*/
class DateTime extends PHPDateTime
{
public function __toString() { return $this->format( PHPDateTime::ATOM ); }
Expand Down
12 changes: 12 additions & 0 deletions tests/LazyRecord/Types/DateTimeTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php
use LazyRecord\Types\DateTime as OurDateTime;

class LazyRecordDateTimeTest extends PHPUnit_Framework_TestCase
{
public function testToString()
{
$dateTime = new OurDateTime;
ok($dateTime->__toString());
}
}

0 comments on commit eae49fd

Please sign in to comment.