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.

ApplicationTest::testRouterIsCalled()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Tests;
6
7
use GuzzleHttp\Psr7\Response;
8
use Lib\Application;
9
use Lib\Http\Request;
10
use Lib\Routing\Router;
11
use PHPUnit\Framework\MockObject\MockObject;
12
13
class ApplicationTest extends TestCase
14
{
15
    protected $app;
16
17
    /**
18
     * @var Router&MockObject
19
     */
20
    protected $router;
21
22
    public function setUp()
23
    {
24
        $this->router = $this
25
            ->getMockBuilder(Router::class)
26
            ->disableOriginalConstructor()
27
            ->disableOriginalClone()
28
            ->disableArgumentCloning()
29
            ->disallowMockingUnknownTypes()
30
            ->setMethods(['route'])
31
            ->getMock();
32
33
        $this->router
34
             ->expects($this->once())
35
             ->method('route')
36
             ->willReturn(['controller' => 'DefaultController', 'action' => 'notFoundAction', 'params' => []]);
37
38
        $this->app = new Application($this->router);
39
    }
40
41
    public function testRouterIsCalled()
42
    {
43
        $this->app->handleRequest(Request::createFromGlobals());
44
    }
45
46
    public function testHandleRequestReturnsResponse()
47
    {
48
        $return = $this->app->handleRequest(new Request());
49
        $this->assertInstanceOf(Response::class, $return);
50
    }
51
}
52