public function testResponseAccessors() { $response = \r8\Env::Response(); $this->assertThat($response, $this->isInstanceOf('\\r8\\iface\\Env\\Response')); $this->assertSame($response, \r8\Env::Response()); $this->assertSame($response, \r8\Env::Response()); $this->assertSame($response, \r8\Env::Response()); }
public function testResponseAccessors() { $root = new \r8\Page($this->getMock("r8\\iface\\Page")); $this->assertSame(\r8\Env::Response(), $root->getResponse()); $this->assertSame(\r8\Env::Response(), $root->getResponse()); $this->assertSame(\r8\Env::Response(), $root->getResponse()); $response = $this->getMock('r8\\iface\\Env\\Response'); $this->assertSame($root, $root->setResponse($response)); $this->assertSame($response, $root->getResponse()); $this->assertSame($response, $root->getResponse()); $this->assertSame($response, $root->getResponse()); }
/** * Returns the response object that will be sent to the client * * @return \r8\iface\Env\Response */ public function getResponse() { if (isset($this->response)) { return $this->response; } else { return \r8\Env::Response(); } }