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 ( bb96e0...68e81a )
by luca
02:33
created

TraitRepositoryTest   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 65
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 0
Metric Value
wmc 6
lcom 1
cbo 3
dl 0
loc 65
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Test\Functional;
4
5
use Audiens\AdobeClient\Entity\TraitMetrics;
6
use Audiens\AdobeClient\Entity\Traits;
7
use Prophecy\Argument;
8
use Test\FunctionalTestCase;
9
10
/**
11
 * Class TraitRepositoryTest
12
 */
13
class TraitRepositoryTest extends FunctionalTestCase
14
{
15
    /**
16
     * @test
17
     */
18
    public function findAll_will_return_a_list_of_trait()
19
    {
20
        $repository = $this->getTraitRepository();
21
22
        $traits = $repository->findAll();
23
24
        $this->assertGreaterThan(0, $traits);
25
26
        foreach ($traits as $trait) {
27
            $this->assertInstanceOf(Traits::class, $trait);
28
        }
29
    }
30
31
    /**
32
     * @test
33
     */
34
    public function findOneByWillReturn_a_trait()
35
    {
36
        $id = 0000; // put a valid trait sid here
37
38
        $repository = $this->getTraitRepository();
39
40
        $traits = $repository->findOneById($id);
41
42
        $this->assertNotEmpty($traits);
43
44
        $this->assertEquals($id, $traits->getSid());
45
    }
46
47
    /**
48
     * @test
49
     */
50
    public function getTrendByTrait()
51
    {
52
        $sid = 5584477;
53
54
        $repository = $this->getTraitRepository();
55
56
        $startDate = new \DateTime('-4 month');
57
        $endDate = new \DateTime('-2 days');
58
59
        /** @var Traits[] $traits */
60
        $traits = $repository->getTrendByTrait($sid, $startDate, $endDate, '1D');
61
62
        $this->assertEquals(1, count($traits));
63
64
        /** @var Traits $trait */
65
        foreach ($traits as $trait) {
66
67
            $this->assertInstanceOf(Traits::class, $trait);
68
69
            $this->assertNotEmpty($trait->getMetrics());
70
71
            foreach($trait->getMetrics() as $metric)
72
            {
73
                $this->assertInstanceOf(TraitMetrics::class, $metric);
74
            }
75
        }
76
    }
77
}