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"); }
public final function processResponse(Response $response) { ob_start(); $this->printLayout($response->getContent()); $fullHtml = ob_get_clean(); $response->setContent($fullHtml); }