@@ 71-82 (lines=12) @@ | ||
68 | $this->assertFalse($shouldFail, 'Expected the invalid ISO 8601 format to fail.'); |
|
69 | } |
|
70 | ||
71 | public function testATimeStampCanBeConvertedToADateTimeObject() |
|
72 | { |
|
73 | $someTimeStampFromGraph = 1405547020; |
|
74 | $graphNode = new GraphNode(); |
|
75 | $dateTime = $graphNode->castToDateTime($someTimeStampFromGraph); |
|
76 | $prettyDate = $dateTime->format(\DateTime::RFC1036); |
|
77 | $timeStamp = $dateTime->getTimestamp(); |
|
78 | ||
79 | $this->assertInstanceOf('DateTime', $dateTime); |
|
80 | $this->assertEquals('Wed, 16 Jul 14 23:43:40 +0200', $prettyDate); |
|
81 | $this->assertEquals(1405547020, $timeStamp); |
|
82 | } |
|
83 | ||
84 | public function testAGraphDateStringCanBeConvertedToADateTimeObject() |
|
85 | { |
|
@@ 84-95 (lines=12) @@ | ||
81 | $this->assertEquals(1405547020, $timeStamp); |
|
82 | } |
|
83 | ||
84 | public function testAGraphDateStringCanBeConvertedToADateTimeObject() |
|
85 | { |
|
86 | $someDateStringFromGraph = '2014-07-15T03:44:53+0000'; |
|
87 | $graphNode = new GraphNode(); |
|
88 | $dateTime = $graphNode->castToDateTime($someDateStringFromGraph); |
|
89 | $prettyDate = $dateTime->format(\DateTime::RFC1036); |
|
90 | $timeStamp = $dateTime->getTimestamp(); |
|
91 | ||
92 | $this->assertInstanceOf('DateTime', $dateTime); |
|
93 | $this->assertEquals('Tue, 15 Jul 14 03:44:53 +0000', $prettyDate); |
|
94 | $this->assertEquals(1405395893, $timeStamp); |
|
95 | } |
|
96 | ||
97 | public function testUncastingAGraphNodeWillUncastTheDateTimeObject() |
|
98 | { |