@@ 215-228 (lines=14) @@ | ||
212 | $this->assertEquals('baz', $graphEdge['faz']); |
|
213 | } |
|
214 | ||
215 | public function testACollectionCanBeIteratedOver() |
|
216 | { |
|
217 | $graphEdge = new GraphEdge($this->request, ['foo' => 'bar', 'faz' => 'baz']); |
|
218 | ||
219 | $this->assertInstanceOf(\IteratorAggregate::class, $graphEdge); |
|
220 | ||
221 | $newArray = []; |
|
222 | ||
223 | foreach ($graphEdge as $k => $v) { |
|
224 | $newArray[$k] = $v; |
|
225 | } |
|
226 | ||
227 | $this->assertEquals(['foo' => 'bar', 'faz' => 'baz'], $newArray); |
|
228 | } |
|
229 | } |
|
230 |
@@ 221-234 (lines=14) @@ | ||
218 | $this->assertEquals('baz', $graphNode['faz']); |
|
219 | } |
|
220 | ||
221 | public function testACollectionCanBeIteratedOver() |
|
222 | { |
|
223 | $graphNode = new GraphNode(['foo' => 'bar', 'faz' => 'baz']); |
|
224 | ||
225 | $this->assertInstanceOf(\IteratorAggregate::class, $graphNode); |
|
226 | ||
227 | $newArray = []; |
|
228 | ||
229 | foreach ($graphNode as $k => $v) { |
|
230 | $newArray[$k] = $v; |
|
231 | } |
|
232 | ||
233 | $this->assertEquals(['foo' => 'bar', 'faz' => 'baz'], $newArray); |
|
234 | } |
|
235 | } |
|
236 |