Fixed PHPUnit assert calls to static.
This commit is contained in:
parent
1dc8acd263
commit
c05d3d6c90
29 changed files with 355 additions and 346 deletions
|
|
@ -9,7 +9,7 @@ class HttpExceptionTest extends \PHPUnit\Framework\TestCase
|
|||
public function testHttpExceptionIsException()
|
||||
{
|
||||
$ex = new HttpException();
|
||||
$this->assertTrue($ex instanceof \Exception);
|
||||
self::assertTrue($ex instanceof \Exception);
|
||||
}
|
||||
|
||||
public function testHttpException()
|
||||
|
|
@ -17,10 +17,10 @@ class HttpExceptionTest extends \PHPUnit\Framework\TestCase
|
|||
try {
|
||||
throw new HttpException('Test');
|
||||
} catch (HttpException $ex) {
|
||||
$this->assertTrue($ex->getMessage() == 'Test');
|
||||
$this->assertTrue($ex->getErrorCode() == 500);
|
||||
$this->assertTrue($ex->getStatusMessage() == 'Internal Server Error');
|
||||
$this->assertTrue($ex->getHttpHeader() == 'HTTP/1.1 500 Internal Server Error');
|
||||
self::assertTrue($ex->getMessage() == 'Test');
|
||||
self::assertTrue($ex->getErrorCode() == 500);
|
||||
self::assertTrue($ex->getStatusMessage() == 'Internal Server Error');
|
||||
self::assertTrue($ex->getHttpHeader() == 'HTTP/1.1 500 Internal Server Error');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -29,8 +29,8 @@ class HttpExceptionTest extends \PHPUnit\Framework\TestCase
|
|||
try {
|
||||
throw new HttpException\BadRequestException('Test');
|
||||
} catch (HttpException $ex) {
|
||||
$this->assertTrue($ex->getErrorCode() == 400);
|
||||
$this->assertTrue($ex->getStatusMessage() == 'Bad Request');
|
||||
self::assertTrue($ex->getErrorCode() == 400);
|
||||
self::assertTrue($ex->getStatusMessage() == 'Bad Request');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -39,8 +39,8 @@ class HttpExceptionTest extends \PHPUnit\Framework\TestCase
|
|||
try {
|
||||
throw new HttpException\ForbiddenException('Test');
|
||||
} catch (HttpException $ex) {
|
||||
$this->assertTrue($ex->getErrorCode() == 403);
|
||||
$this->assertTrue($ex->getStatusMessage() == 'Forbidden');
|
||||
self::assertTrue($ex->getErrorCode() == 403);
|
||||
self::assertTrue($ex->getStatusMessage() == 'Forbidden');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -49,8 +49,8 @@ class HttpExceptionTest extends \PHPUnit\Framework\TestCase
|
|||
try {
|
||||
throw new HttpException\NotAuthorizedException('Test');
|
||||
} catch (HttpException $ex) {
|
||||
$this->assertTrue($ex->getErrorCode() == 401);
|
||||
$this->assertTrue($ex->getStatusMessage() == 'Not Authorized');
|
||||
self::assertTrue($ex->getErrorCode() == 401);
|
||||
self::assertTrue($ex->getStatusMessage() == 'Not Authorized');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -59,8 +59,8 @@ class HttpExceptionTest extends \PHPUnit\Framework\TestCase
|
|||
try {
|
||||
throw new HttpException\NotFoundException('Test');
|
||||
} catch (HttpException $ex) {
|
||||
$this->assertTrue($ex->getErrorCode() == 404);
|
||||
$this->assertTrue($ex->getStatusMessage() == 'Not Found');
|
||||
self::assertTrue($ex->getErrorCode() == 404);
|
||||
self::assertTrue($ex->getStatusMessage() == 'Not Found');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -69,8 +69,8 @@ class HttpExceptionTest extends \PHPUnit\Framework\TestCase
|
|||
try {
|
||||
throw new HttpException\ServerErrorException('Test');
|
||||
} catch (HttpException $ex) {
|
||||
$this->assertTrue($ex->getErrorCode() == 500);
|
||||
$this->assertTrue($ex->getStatusMessage() == 'Internal Server Error');
|
||||
self::assertTrue($ex->getErrorCode() == 500);
|
||||
self::assertTrue($ex->getStatusMessage() == 'Internal Server Error');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -79,8 +79,8 @@ class HttpExceptionTest extends \PHPUnit\Framework\TestCase
|
|||
try {
|
||||
throw new HttpException\ValidationException('Test');
|
||||
} catch (HttpException $ex) {
|
||||
$this->assertTrue($ex->getErrorCode() == 400);
|
||||
$this->assertTrue($ex->getStatusMessage() == 'Bad Request');
|
||||
self::assertTrue($ex->getErrorCode() == 400);
|
||||
self::assertTrue($ex->getStatusMessage() == 'Bad Request');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue