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

ArtistTopAlbumsBuilderTest   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 74
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

6 Methods

Rating   Name   Duplication   Size   Complexity  
A testForMbid() 0 9 1
A testForArtist() 0 9 1
A testAutocorrect() 0 12 1
A testNoAutocorrect() 0 12 1
A testLimit() 0 12 1
A testPage() 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\ArtistTopAlbumsBuilder;
13
use PHPUnit\Framework\TestCase;
14
15
class ArtistTopAlbumsBuilderTest extends TestCase
16
{
17
    public function testForMbid(): void
18
    {
19
        $builder = ArtistTopAlbumsBuilder::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 testForArtist(): void
28
    {
29
        $builder = ArtistTopAlbumsBuilder::forArtist('Slipknot');
30
31
        $expected = [
32
            'artist' => 'Slipknot',
33
        ];
34
        $this->assertSame($expected, $builder->getQuery());
35
    }
36
37
    public function testAutocorrect(): void
38
    {
39
        $builder = ArtistTopAlbumsBuilder::forMbid('a466c2a2-6517-42fb-a160-1087c3bafd9f')
40
            ->autocorrect(true)
41
        ;
42
43
        $expected = [
44
            'mbid'        => 'a466c2a2-6517-42fb-a160-1087c3bafd9f',
45
            'autocorrect' => 1,
46
        ];
47
        $this->assertSame($expected, $builder->getQuery());
48
    }
49
50
    public function testNoAutocorrect(): void
51
    {
52
        $builder = ArtistTopAlbumsBuilder::forMbid('a466c2a2-6517-42fb-a160-1087c3bafd9f')
53
            ->autocorrect(false)
54
        ;
55
56
        $expected = [
57
            'mbid'        => 'a466c2a2-6517-42fb-a160-1087c3bafd9f',
58
            'autocorrect' => 0,
59
        ];
60
        $this->assertSame($expected, $builder->getQuery());
61
    }
62
63
    public function testLimit(): void
64
    {
65
        $builder = ArtistTopAlbumsBuilder::forMbid('a466c2a2-6517-42fb-a160-1087c3bafd9f')
66
            ->limit(20)
67
        ;
68
69
        $expected = [
70
            'mbid'        => 'a466c2a2-6517-42fb-a160-1087c3bafd9f',
71
            'limit'       => 20,
72
        ];
73
        $this->assertSame($expected, $builder->getQuery());
74
    }
75
76
    public function testPage(): void
77
    {
78
        $builder = ArtistTopAlbumsBuilder::forMbid('a466c2a2-6517-42fb-a160-1087c3bafd9f')
79
            ->page(13)
80
        ;
81
82
        $expected = [
83
            'mbid'        => 'a466c2a2-6517-42fb-a160-1087c3bafd9f',
84
            'page'        => 13,
85
        ];
86
        $this->assertSame($expected, $builder->getQuery());
87
    }
88
}
89