Passed
Pull Request — master (#17)
by Mihail
15:10
created

StatusCodeTest::test_description()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 3
c 1
b 0
f 1
nc 1
nop 0
dl 0
loc 5
rs 10
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
The method METHOD_NOT_ALLOWED() 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 ignore-call  annotation

13
        $this->assertSame('405 Method Not Allowed', StatusCode::/** @scrutinizer ignore-call */ METHOD_NOT_ALLOWED(true));
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
Bug introduced by
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 ignore-call  annotation

15
        $this->assertSame(null, StatusCode::/** @scrutinizer ignore-call */ something_non_existent());
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