@@ 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 |
@@ 200-213 (lines=14) @@ | ||
197 | $this->assertEquals('baz', $graphNode['faz']); |
|
198 | } |
|
199 | ||
200 | public function testAGraphNodeCanBeIteratedOver() |
|
201 | { |
|
202 | $graphNode = new GraphNode(['foo' => 'bar', 'faz' => 'baz']); |
|
203 | ||
204 | $this->assertInstanceOf(\IteratorAggregate::class, $graphNode); |
|
205 | ||
206 | $newArray = []; |
|
207 | ||
208 | foreach ($graphNode as $k => $v) { |
|
209 | $newArray[$k] = $v; |
|
210 | } |
|
211 | ||
212 | $this->assertEquals(['foo' => 'bar', 'faz' => 'baz'], $newArray); |
|
213 | } |
|
214 | } |
|
215 |