Ejemplo n.º 1
0
 /**
  * @expectedException InvalidArgumentException
  * @depends testResponseCodeGetSet
  */
 public function testResponseCodeSetInvalid()
 {
     $response = new Response();
     $testCode = 666;
     $this->assertFalse(ResponseCode::isValid($testCode));
     $response->setResponseCode($testCode);
     // should raise exception
 }
Ejemplo n.º 2
0
 public function testIsValid()
 {
     $this->assertTrue(ResponseCode::isValid(200));
     $this->assertTrue(ResponseCode::isValid(100));
     $this->assertTrue(ResponseCode::isValid(404));
     $this->assertTrue(ResponseCode::isValid(ResponseCode::HTTP_IM_A_TEAPOT));
     $this->assertFalse(ResponseCode::isValid(''));
     $this->assertFalse(ResponseCode::isValid(0));
     $this->assertFalse(ResponseCode::isValid(999));
     $this->assertFalse(ResponseCode::isValid('a'));
 }