Exemplo n.º 1
0
 /**
  * Set the status code and text
  *
  * @see \sndsgd\http\Code
  * @param integer $code The http status code
  * @return \sndsgd\http\Response
  */
 public function setStatus(int $code) : Response
 {
     # `Status::getText` will throw an exception for invalid status codes
     $this->statusText = Status::getText($code);
     $this->statusCode = $code;
     return $this;
 }
Exemplo n.º 2
0
 public function testGetAndSetText()
 {
     $this->status->setText('text');
     $this->assertEquals('text', $this->status->getText());
 }
Exemplo n.º 3
0
 /**
  * Tests Status->getText()
  */
 public function testGetText()
 {
     $this->Status = new Status("40", new \DateTime(), new \Model\User(null, "toto", password_hash("toto", PASSWORD_DEFAULT)), "status test");
     $this->assertEquals("status test", $this->Status->getText());
 }