Ejemplo n.º 1
0
 public function testSetContent()
 {
     $string_content = "This is some string content";
     $array_content = ["Key" => "Value"];
     $object_content = new \stdClass();
     $object_content->foo = 'bar';
     $object_content->baz = 1;
     $this->assertNull($this->response->getContent(), "Content hasn't been set yet, should be NULL");
     $this->response->setContent($string_content);
     $this->assertEquals($this->response->getContent(), $string_content, "Got content did not equal set string content");
     $this->response->setContent($array_content);
     $this->assertEquals($this->response->getContent(), $array_content, "Got content did not equal set array content");
     $this->response->setContent($object_content);
     $this->assertEquals($this->response->getContent(), $object_content, "Got content did not equal set object content");
 }
Ejemplo n.º 2
0
 public final function processResponse(Response $response)
 {
     ob_start();
     $this->printLayout($response->getContent());
     $fullHtml = ob_get_clean();
     $response->setContent($fullHtml);
 }