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.

AuthSuccessEventTest   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 1
dl 0
loc 42
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A testGetUsername() 0 9 1
A testGetSession() 0 8 1
A testGetResponse() 0 8 1
A testSetResponse() 0 11 1
1
<?php
2
3
/*
4
 * (c) Christian Gripp <[email protected]>
5
 *
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 */
9
10
namespace Core23\LastFmBundle\Tests\Event;
11
12
use Core23\LastFm\Session\SessionInterface;
13
use Core23\LastFmBundle\Event\AuthSuccessEvent;
14
use PHPUnit\Framework\TestCase;
15
use Symfony\Component\HttpFoundation\Response;
16
17
final class AuthSuccessEventTest extends TestCase
18
{
19
    public function testGetUsername(): void
20
    {
21
        $session = $this->prophesize(SessionInterface::class);
22
        $session->getName()->willReturn('MyUser');
23
24
        $event = new AuthSuccessEvent($session->reveal());
25
26
        static::assertSame('MyUser', $event->getUsername());
27
    }
28
29
    public function testGetSession(): void
30
    {
31
        $session = $this->prophesize(SessionInterface::class);
32
33
        $event = new AuthSuccessEvent($session->reveal());
34
35
        static::assertSame($session->reveal(), $event->getSession());
36
    }
37
38
    public function testGetResponse(): void
39
    {
40
        $session = $this->prophesize(SessionInterface::class);
41
42
        $event = new AuthSuccessEvent($session->reveal());
43
44
        static::assertNull($event->getResponse());
45
    }
46
47
    public function testSetResponse(): void
48
    {
49
        $session = $this->prophesize(SessionInterface::class);
50
51
        $reponse = $this->prophesize(Response::class);
52
53
        $event = new AuthSuccessEvent($session->reveal());
54
        $event->setResponse($reponse->reveal());
55
56
        static::assertSame($reponse->reveal(), $event->getResponse());
57
    }
58
}
59