GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Pull Request — master (#1)
by Pascal
04:06
created

testHeaderIsCreatedCorrectly()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 8
nc 1
nop 0
dl 0
loc 12
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Saikootau\ApiBundle\Tests\Resource\Builder;
6
7
use PHPUnit\Framework\TestCase;
8
use Saikootau\ApiBundle\Resource\Builder\HeaderResourceBuilder;
9
use Saikootau\ApiBundle\Resource\Header;
10
use Symfony\Component\HttpFoundation\Request;
11
12
class HeaderResourceBuilderTest extends TestCase
13
{
14
    public function testHeadersAreCreated(): void
15
    {
16
        $builder = new HeaderResourceBuilder();
17
        $request = new Request();
18
        $request->headers->set('Content-Type', ['application/json']);
19
        $request->headers->set('Host', ['localhost']);
20
        $request->headers->set('X-Test', ['test1', 'test2']);
21
22
        $headers = $builder->build($request);
23
24
        $this->assertCount(4, $headers);
25
        $this->assertContainsOnly(Header::class, $headers);
26
    }
27
28
    public function testHeaderIsCreatedCorrectly(): void
29
    {
30
        $builder = new HeaderResourceBuilder();
31
        $request = new Request();
32
        $request->headers->set('Content-Type', ['application/json']);
33
34
        $headers = $builder->build($request);
35
36
        $this->assertCount(1, $headers);
37
        $this->assertContainsOnly(Header::class, $headers);
38
        $this->assertRegExp('/^content\-type$/i', $headers[0]->getName());
39
        $this->assertSame('application/json', $headers[0]->getValue());
40
    }
41
}
42