kodedphp /
http
| 1 | <?php |
||||
| 2 | |||||
| 3 | namespace Tests\Koded\Http; |
||||
| 4 | |||||
| 5 | use Koded\Http\Interfaces\HttpStatus; |
||||
| 6 | use Koded\Http\StatusCode; |
||||
| 7 | use PHPUnit\Framework\TestCase; |
||||
| 8 | |||||
| 9 | class StatusCodeTest extends TestCase |
||||
| 10 | { |
||||
| 11 | public function test__callStatic() |
||||
| 12 | { |
||||
| 13 | $this->assertSame('405 Method Not Allowed', StatusCode::METHOD_NOT_ALLOWED(true)); |
||||
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||||
| 14 | $this->assertSame('Method Not Allowed', StatusCode::METHOD_NOT_ALLOWED(false)); |
||||
| 15 | $this->assertSame(null, StatusCode::something_non_existent()); |
||||
|
0 ignored issues
–
show
The method
something_non_existent() does not exist on Koded\Http\StatusCode. Since you implemented __callStatic, consider adding a @method annotation.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||
| 16 | } |
||||
| 17 | |||||
| 18 | public function test_description() |
||||
| 19 | { |
||||
| 20 | $this->assertSame('', StatusCode::description(HttpStatus::CREATED)); |
||||
| 21 | $this->assertSame('The origin server requires the request to be conditional', |
||||
| 22 | StatusCode::description(HttpStatus::PRECONDITION_REQUIRED)); |
||||
| 23 | } |
||||
| 24 | } |
||||
| 25 |