示例#1
0
 public function testIsError()
 {
     $this->assertTrue(ResponseCode::isError(ResponseCode::HTTP_NOT_FOUND));
     $this->assertTrue(ResponseCode::isError(ResponseCode::HTTP_INTERNAL_SERVER_ERROR));
     $this->assertTrue(ResponseCode::isError(ResponseCode::HTTP_BAD_GATEWAY));
     $this->assertTrue(ResponseCode::isError(ResponseCode::HTTP_BAD_REQUEST));
     $this->assertFalse(ResponseCode::isError(ResponseCode::HTTP_OK));
     $this->assertFalse(ResponseCode::isError(ResponseCode::HTTP_CONTINUE));
     $this->assertFalse(ResponseCode::isError(ResponseCode::HTTP_IM_A_TEAPOT));
     $this->assertFalse(ResponseCode::isError(''));
     $this->assertFalse(ResponseCode::isError('a'));
     $this->assertTrue(ResponseCode::isError('999'));
 }