public function testGetResponseStatusCode() { $curl = new Curl(array('proxy_host' => false)); $curl->exec(sprintf('http://localhost:%d/curl.txt', WEBSERVER_PORT)); $this->assertEquals(200, $curl->getResponseStatusCode()); $curl->exec(sprintf('http://localhost:%d/404.txt', WEBSERVER_PORT)); $this->assertEquals(404, $curl->getResponseStatusCode()); }
public function testGetResponseStatusCode() { $this->startPhpWebserver(); $curl = new Curl(); $curl->exec('http://localhost:8000/curl.txt'); $this->assertEquals(200, $curl->getResponseStatusCode()); $curl->exec('http://localhost:8000/404.txt'); $this->assertEquals(404, $curl->getResponseStatusCode()); $this->stopPhpWebserver(); }