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.
Passed
Push — master ( db5293...0ee186 )
by Benjamin
03:29
created

ResponseSenderTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 18
dl 0
loc 43
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 5 1
A testSendHeadersAlreadySent() 0 10 1
A testSendResponse() 0 7 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Tests\Lib\Http;
6
7
use Lib\Application;
8
use Lib\Http\Request;
9
use Lib\Http\ResponseSender;
10
use Psr\Http\Message\ResponseInterface;
11
use Tests\TestCase;
12
13
class ResponseSenderTest extends TestCase
14
{
15
    /** @var Application */
16
    private $application;
17
18
    /** @var ResponseInterface */
19
    private $response;
20
21
    /** @var ResponseSender */
22
    private $sender;
23
24
    public function setUp()
25
    {
26
        $this->application = new Application();
27
        $this->response = $this->application->handleRequest(new Request([], [], [], ['REQUEST_URI' => '/dummy']));
28
        $this->sender = new ResponseSender($this->response);
29
    }
30
31
    /**
32
     * @runInSeparateProcess
33
     */
34
    public function testSendResponse()
35
    {
36
        ob_start();
37
        $this->sender->sendResponse();
38
        $echo = ob_get_clean();
39
40
        $this->assertEquals('Not Found', $echo);
41
    }
42
43
    /**
44
     * @runInSeparateProcess
45
     */
46
    public function testSendHeadersAlreadySent()
47
    {
48
        global $headersSent;
49
        $headersSent = true;
50
        ob_start();
51
        $this->sender->sendResponse();
52
        $echo = ob_get_clean();
53
54
        $this->assertEquals('Not Found', $echo);
55
        $this->assertTrue(headers_sent());
56
    }
57
}
58