public function testIteration() { $tests = $results = array(); $test = $result = null; for ($x = 0; $x < 10; $x++) { $test = new AlwaysSuccess(); $result = new Success(); $tests[] = $test; $results[] = $result; $this->collection[$test] = $result; } $x = 0; $this->collection->rewind(); foreach ($this->collection as $test) { $this->assertSame($tests[$x], $test); $this->assertSame($results[$x], $this->collection[$test]); $x++; } }