public function testSettingNextResponseByIndex() { $expected = array("HTTP/1.1 200 OK\r\n\r\n", "HTTP/1.1 302 Moved Temporarily\r\n\r\n", "HTTP/1.1 404 Not Found\r\n\r\n"); $this->adapter->setResponse($expected); $this->assertEquals($expected[0], $this->adapter->read()); foreach ($expected as $i => $expected) { $this->adapter->setResponseIndex($i); $this->assertEquals($expected, $this->adapter->read()); } }