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

SimilarArtistBuilderTest   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 61
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 5
lcom 0
cbo 1
dl 0
loc 61
rs 10
c 0
b 0
f 0

5 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
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\SimilarArtistBuilder;
13
use PHPUnit\Framework\TestCase;
14
15
class SimilarArtistBuilderTest extends TestCase
16
{
17
    public function testForMbid(): void
18
    {
19
        $builder = SimilarArtistBuilder::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 = SimilarArtistBuilder::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 = SimilarArtistBuilder::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 = SimilarArtistBuilder::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 = SimilarArtistBuilder::forMbid('a466c2a2-6517-42fb-a160-1087c3bafd9f')
66
            ->limit(13)
67
        ;
68
69
        $expected = [
70
            'mbid'     => 'a466c2a2-6517-42fb-a160-1087c3bafd9f',
71
            'limit'    => 13,
72
        ];
73
        $this->assertSame($expected, $builder->getQuery());
74
    }
75
}
76