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

ScrobbeBuilderTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 2
dl 0
loc 40
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A testCreate() 0 8 1
A testCount() 0 6 1
A testAddTrack() 0 21 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\ScrobbeBuilder;
13
use Core23\LastFm\Builder\TrackBuilder;
14
use DateTime;
15
use PHPUnit\Framework\TestCase;
16
17
class ScrobbeBuilderTest extends TestCase
18
{
19
    public function testCreate(): void
20
    {
21
        $builder = ScrobbeBuilder::create();
22
23
        $expected = [
24
        ];
25
        $this->assertSame($expected, $builder->getQuery());
26
    }
27
28
    public function testCount(): void
29
    {
30
        $builder = ScrobbeBuilder::create();
31
32
        $this->assertSame(0, $builder->count());
33
    }
34
35
    public function testAddTrack(): void
36
    {
37
        $now       = new DateTime();
38
        $yesterday = new DateTime('Yesterday');
39
40
        $builder = ScrobbeBuilder::create()
41
            ->addTrack(TrackBuilder::create('Slipknot', 'Before I Forget', $now))
42
            ->addTrack(TrackBuilder::create('The Beatles', 'Yesterday', $yesterday))
43
        ;
44
45
        $expected = [
46
            'artist[0]'    => 'Slipknot',
47
            'track[0]'     => 'Before I Forget',
48
            'timestamp[0]' => $now->getTimestamp(),
49
            'artist[1]'    => 'The Beatles',
50
            'track[1]'     => 'Yesterday',
51
            'timestamp[1]' => $yesterday->getTimestamp(),
52
        ];
53
        $this->assertSame($expected, $builder->getQuery());
54
        $this->assertSame(2, $builder->count());
55
    }
56
}
57