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   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 19
dl 0
loc 37
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A testRouterIsCalled() 0 3 1
A setUp() 0 17 1
A testHandleRequestReturnsResponse() 0 4 1
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