Exemple #1
0
 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());
 }
Exemple #2
0
 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());
 }
Exemple #3
0
 /**
  * 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();
     }
 }