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

TrackBuilderTest::testWithTrackNumber()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 16

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 16
rs 9.7333
c 0
b 0
f 0
cc 1
nc 1
nop 0
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\TrackBuilder;
13
use DateTime;
14
use PHPUnit\Framework\TestCase;
15
16
class TrackBuilderTest extends TestCase
17
{
18
    public function testCreate(): void
19
    {
20
        $now = new DateTime();
21
22
        $builder = TrackBuilder::create('Slipknot', 'Before I Forget', $now);
23
24
        $expected = [
25
            'artist'    => 'Slipknot',
26
            'track'     => 'Before I Forget',
27
            'timestamp' => $now->getTimestamp(),
28
        ];
29
        $this->assertSame($expected, $builder->getData());
30
    }
31
32
    public function testWithAlbum(): void
33
    {
34
        $now = new DateTime();
35
36
        $builder = TrackBuilder::create('Slipknot', 'Before I Forget', $now)
37
            ->withAlbum('IOWA')
38
        ;
39
40
        $expected = [
41
            'artist'    => 'Slipknot',
42
            'track'     => 'Before I Forget',
43
            'timestamp' => $now->getTimestamp(),
44
            'album'     => 'IOWA',
45
        ];
46
        $this->assertSame($expected, $builder->getData());
47
    }
48
49
    public function testWithAlbumArtist(): void
50
    {
51
        $now = new DateTime();
52
53
        $builder = TrackBuilder::create('Slipknot', 'Before I Forget', $now)
54
            ->withAlbumArtist('Slipknot')
55
        ;
56
57
        $expected = [
58
            'artist'      => 'Slipknot',
59
            'track'       => 'Before I Forget',
60
            'timestamp'   => $now->getTimestamp(),
61
            'albumArtist' => 'Slipknot',
62
        ];
63
        $this->assertSame($expected, $builder->getData());
64
    }
65
66
    public function testWithChosenByUser(): void
67
    {
68
        $now = new DateTime();
69
70
        $builder = TrackBuilder::create('Slipknot', 'Before I Forget', $now)
71
            ->withChosenByUser(true)
72
        ;
73
74
        $expected = [
75
            'artist'       => 'Slipknot',
76
            'track'        => 'Before I Forget',
77
            'timestamp'    => $now->getTimestamp(),
78
            'chosenByUser' => 1,
79
        ];
80
        $this->assertSame($expected, $builder->getData());
81
    }
82
83
    public function testWithTrackNumber(): void
84
    {
85
        $now = new DateTime();
86
87
        $builder = TrackBuilder::create('Slipknot', 'Before I Forget', $now)
88
            ->withTrackNumber(11)
89
        ;
90
91
        $expected = [
92
            'artist'      => 'Slipknot',
93
            'track'       => 'Before I Forget',
94
            'timestamp'   => $now->getTimestamp(),
95
            'trackNumber' => 11,
96
        ];
97
        $this->assertSame($expected, $builder->getData());
98
    }
99
100
    public function testWithStreamId(): void
101
    {
102
        $now = new DateTime();
103
104
        $builder = TrackBuilder::create('Slipknot', 'Before I Forget', $now)
105
            ->withStreamId(11)
106
        ;
107
108
        $expected = [
109
            'artist'    => 'Slipknot',
110
            'track'     => 'Before I Forget',
111
            'timestamp' => $now->getTimestamp(),
112
            'streamId'  => 11,
113
        ];
114
        $this->assertSame($expected, $builder->getData());
115
    }
116
117
    public function testWithContext(): void
118
    {
119
        $now = new DateTime();
120
121
        $builder = TrackBuilder::create('Slipknot', 'Before I Forget', $now)
122
            ->withContext('Client Version')
123
        ;
124
125
        $expected = [
126
            'artist'    => 'Slipknot',
127
            'track'     => 'Before I Forget',
128
            'timestamp' => $now->getTimestamp(),
129
            'context'   => 'Client Version',
130
        ];
131
        $this->assertSame($expected, $builder->getData());
132
    }
133
134
    public function testWithMbid(): void
135
    {
136
        $now = new DateTime();
137
138
        $builder = TrackBuilder::create('Slipknot', 'Before I Forget', $now)
139
            ->withMbid('a466c2a2-6517-42fb-a160-1087c3bafd9f')
140
        ;
141
142
        $expected = [
143
            'artist'    => 'Slipknot',
144
            'track'     => 'Before I Forget',
145
            'timestamp' => $now->getTimestamp(),
146
            'mbid'      => 'a466c2a2-6517-42fb-a160-1087c3bafd9f',
147
        ];
148
        $this->assertSame($expected, $builder->getData());
149
    }
150
151
    public function testWithDuration(): void
152
    {
153
        $now = new DateTime();
154
155
        $builder = TrackBuilder::create('Slipknot', 'Before I Forget', $now)
156
            ->withDuration(183)
157
        ;
158
159
        $expected = [
160
            'artist'    => 'Slipknot',
161
            'track'     => 'Before I Forget',
162
            'timestamp' => $now->getTimestamp(),
163
            'duration'  => 183,
164
        ];
165
        $this->assertSame($expected, $builder->getData());
166
    }
167
}
168