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
Push — master ( 3b6389...625674 )
by Christian
01:43
created

AlbumInfoBuilderTest   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 75
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 6
lcom 0
cbo 1
dl 0
loc 75
rs 10
c 0
b 0
f 0

6 Methods

Rating   Name   Duplication   Size   Complexity  
A testForMbid() 0 9 1
A testForAlbum() 0 10 1
A testForUsername() 0 12 1
A testLanguage() 0 12 1
A testAutocorrect() 0 12 1
A testNoAutocorrect() 0 12 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\LastFm\Tests\Builder;
11
12
use Core23\LastFm\Builder\AlbumInfoBuilder;
13
use PHPUnit\Framework\TestCase;
14
15
class AlbumInfoBuilderTest extends TestCase
16
{
17
    public function testForMbid(): void
18
    {
19
        $builder = AlbumInfoBuilder::forMbid('a466c2a2-6517-42fb-a160-1087c3bafd9f');
20
21
        $expected = [
22
            'mbid' => 'a466c2a2-6517-42fb-a160-1087c3bafd9f',
23
        ];
24
        $this->assertSame($expected, $builder->getQuery());
25
    }
26
27
    public function testForAlbum(): void
28
    {
29
        $builder = AlbumInfoBuilder::forAlbum('Slipknot', 'IOWA');
30
31
        $expected = [
32
            'artist' => 'Slipknot',
33
            'album'  => 'IOWA',
34
        ];
35
        $this->assertSame($expected, $builder->getQuery());
36
    }
37
38
    public function testForUsername(): void
39
    {
40
        $builder = AlbumInfoBuilder::forMbid('a466c2a2-6517-42fb-a160-1087c3bafd9f')
41
            ->forUsername('MyUser')
42
        ;
43
44
        $expected = [
45
            'mbid'     => 'a466c2a2-6517-42fb-a160-1087c3bafd9f',
46
            'username' => 'MyUser',
47
        ];
48
        $this->assertSame($expected, $builder->getQuery());
49
    }
50
51
    public function testLanguage(): void
52
    {
53
        $builder = AlbumInfoBuilder::forMbid('a466c2a2-6517-42fb-a160-1087c3bafd9f')
54
            ->language('DE')
55
        ;
56
57
        $expected = [
58
            'mbid' => 'a466c2a2-6517-42fb-a160-1087c3bafd9f',
59
            'lang' => 'DE',
60
        ];
61
        $this->assertSame($expected, $builder->getQuery());
62
    }
63
64
    public function testAutocorrect(): void
65
    {
66
        $builder = AlbumInfoBuilder::forMbid('a466c2a2-6517-42fb-a160-1087c3bafd9f')
67
            ->autocorrect(true)
68
        ;
69
70
        $expected = [
71
            'mbid'        => 'a466c2a2-6517-42fb-a160-1087c3bafd9f',
72
            'autocorrect' => 1,
73
        ];
74
        $this->assertSame($expected, $builder->getQuery());
75
    }
76
77
    public function testNoAutocorrect(): void
78
    {
79
        $builder = AlbumInfoBuilder::forMbid('a466c2a2-6517-42fb-a160-1087c3bafd9f')
80
            ->autocorrect(false)
81
        ;
82
83
        $expected = [
84
            'mbid'        => 'a466c2a2-6517-42fb-a160-1087c3bafd9f',
85
            'autocorrect' => 0,
86
        ];
87
        $this->assertSame($expected, $builder->getQuery());
88
    }
89
}
90