|
@@ 121-131 (lines=11) @@
|
| 118 |
|
$this->assertInstanceOf(\DateTime::class, $graphNodeAsArray['created_time']); |
| 119 |
|
} |
| 120 |
|
|
| 121 |
|
public function testGettingAGraphNodeAsAStringWillSafelyRepresentDateTimes() |
| 122 |
|
{ |
| 123 |
|
$graphNode = new GraphNode([ |
| 124 |
|
'id' => '123', |
| 125 |
|
'created_time' => '2014-07-15T03:44:53+0000', |
| 126 |
|
]); |
| 127 |
|
|
| 128 |
|
$graphNodeAsString = (string) $graphNode; |
| 129 |
|
|
| 130 |
|
$this->assertEquals('{"id":"123","created_time":"2014-07-15T03:44:53+0000"}', $graphNodeAsString); |
| 131 |
|
} |
| 132 |
|
|
| 133 |
|
public function testAnExistingFieldCanBeAccessed() |
| 134 |
|
{ |
|
@@ 183-190 (lines=8) @@
|
| 180 |
|
$this->assertEquals(['field1', 'field2', 'field3'], $fieldNames); |
| 181 |
|
} |
| 182 |
|
|
| 183 |
|
public function testAGraphNodeCanBeConvertedToAString() |
| 184 |
|
{ |
| 185 |
|
$graphNode = new GraphNode(['foo', 'bar', 123]); |
| 186 |
|
|
| 187 |
|
$graphNodeAsString = (string) $graphNode; |
| 188 |
|
|
| 189 |
|
$this->assertEquals('["foo","bar",123]', $graphNodeAsString); |
| 190 |
|
} |
| 191 |
|
|
| 192 |
|
public function testAGraphNodeCanBeAccessedAsAnArray() |
| 193 |
|
{ |