/** * Method to test validateStatus(). * * @return void * * @covers \Windwalker\Http\Helper\ResponseHelper::validateStatus */ public function testValidateStatus() { $this->assertTrue(ResponseHelper::validateStatus(200)); $this->assertFalse(ResponseHelper::validateStatus(700)); }
/** * Gets the response reason phrase associated with the status code. * * Because a reason phrase is not a required element in a response * status line, the reason phrase value MAY be null. Implementations MAY * choose to return the default RFC 7231 recommended reason phrase (or those * listed in the IANA HTTP Status Code Structure) for the response's * status code. * * @link http://tools.ietf.org/html/rfc7231#section-6 * @link http://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml * * @return string Reason phrase; must return an empty string if none present. */ public function getReasonPhrase() { if (!$this->reasonPhrase) { $this->reasonPhrase = ResponseHelper::getPhrase($this->statusCode); } return $this->reasonPhrase; }