| @@ 19-34 (lines=16) @@ | ||
| 16 | ||
| 17 | class ConstructTest extends AbstractTestCase |
|
| 18 | { |
|
| 19 | public function testCreatesAnInstanceDefaultToNow() |
|
| 20 | { |
|
| 21 | $c = new Date(); |
|
| 22 | $now = Date::now(); |
|
| 23 | $this->assertInstanceOfDate($c); |
|
| 24 | $this->assertSame($now->getTimezoneName(), $c->getTimezoneName()); |
|
| 25 | $this->assertDate( |
|
| 26 | $c, |
|
| 27 | $now->getYear(), |
|
| 28 | $now->getMonth(), |
|
| 29 | $now->getDay(), |
|
| 30 | $now->getHour(), |
|
| 31 | $now->getMinute(), |
|
| 32 | $now->getSecond() |
|
| 33 | ); |
|
| 34 | } |
|
| 35 | ||
| 36 | public function testParseCreatesAnInstanceDefaultToNow() |
|
| 37 | { |
|
| @@ 36-51 (lines=16) @@ | ||
| 33 | ); |
|
| 34 | } |
|
| 35 | ||
| 36 | public function testParseCreatesAnInstanceDefaultToNow() |
|
| 37 | { |
|
| 38 | $c = Date::parse(); |
|
| 39 | $now = Date::now(); |
|
| 40 | $this->assertInstanceOfDate($c); |
|
| 41 | $this->assertSame($now->getTimezoneName(), $c->getTimezoneName()); |
|
| 42 | $this->assertDate( |
|
| 43 | $c, |
|
| 44 | $now->getYear(), |
|
| 45 | $now->getMonth(), |
|
| 46 | $now->getDay(), |
|
| 47 | $now->getHour(), |
|
| 48 | $now->getMinute(), |
|
| 49 | $now->getSecond() |
|
| 50 | ); |
|
| 51 | } |
|
| 52 | ||
| 53 | public function testWithFancyString() |
|
| 54 | { |
|