Esempio n. 1
0
 public function testModifiingBody()
 {
     self::assertNull($this->response->getBody());
     $this->response->appendToBody('foo');
     self::assertEquals('foo', $this->response->getBody());
     $this->response->appendToBody('bar');
     self::assertEquals('foobar', $this->response->getBody());
     $this->response->setBody('baz');
     self::assertEquals('baz', $this->response->getBody());
 }
Esempio n. 2
0
 public function update(\Nano\Controller\Response $response)
 {
     $contents = $response->getBody();
     $response->setBody('<h1>Unexpected Error</h1>');
     $response->appendToBody($contents);
 }