@@ 129-139 (lines=11) @@ | ||
126 | $this->assertInstanceOf(\DateTime::class, $graphNodeAsArray['created_time']); |
|
127 | } |
|
128 | ||
129 | public function testGettingAGraphNodeAsAStringWillSafelyRepresentDateTimes() |
|
130 | { |
|
131 | $graphNode = new GraphNode([ |
|
132 | 'id' => '123', |
|
133 | 'created_time' => '2014-07-15T03:44:53+0000', |
|
134 | ]); |
|
135 | ||
136 | $graphNodeAsString = (string) $graphNode; |
|
137 | ||
138 | $this->assertEquals('{"id":"123","created_time":"2014-07-15T03:44:53+0000"}', $graphNodeAsString); |
|
139 | } |
|
140 | ||
141 | public function testAnExistingFieldCanBeAccessed() |
|
142 | { |
|
@@ 191-198 (lines=8) @@ | ||
188 | $this->assertEquals(['field1', 'field2', 'field3'], $fieldNames); |
|
189 | } |
|
190 | ||
191 | public function testAGraphNodeCanBeConvertedToAString() |
|
192 | { |
|
193 | $graphNode = new GraphNode(['foo', 'bar', 123]); |
|
194 | ||
195 | $graphNodeAsString = (string) $graphNode; |
|
196 | ||
197 | $this->assertEquals('["foo","bar",123]', $graphNodeAsString); |
|
198 | } |
|
199 | } |
|
200 |