/** * @expectedException InvalidArgumentException * @return null */ public function testLoadHeaderNotHeaderInterfaceFirstOneValid() { $header = 'Location: http://www.example.com/'; $response = new HttpResponse(); $headers = array($header, new StdClass()); $response->loadHeaders($headers); }
/** * @depends testGetAddHeader * @return null */ public function testLoadHeaders() { $headers = array('Status: 404 Not Found', 'WWW-Authenticate: Negotiate', 'Content-type: application/pdf'); $this->assertEquals(array(), $this->response->getAllHeaders()); $this->assertSame($this->response, $this->response->loadHeaders($headers), 'uses fluent interface'); $this->assertEquals($headers, $this->response->getAllHeaders()); }