/** * setContent always converts any object supporting to string into a * string and assigns the string. getContent always returns a string * * @depends testIsValidContent * @return null */ public function testGetSetContentObjectSupportingToString() { $data = new HttpStatus(); $this->assertNotEquals($data, $this->response->getContent()); $this->assertSame($this->response, $this->response->setContent($data), 'exposes fluent interface'); $this->assertEquals((string) $data, $this->response->getContent()); }
/** * @expectedException InvalidArgumentException * @return null */ public function testSetContentObjectDoesNotSupportToString() { $response = new HttpResponse(); $response->setContent(new StdClass()); }