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.
Test Failed
Pull Request — master (#18)
by Kristjan
03:12
created

IsoChronicTest::isoChronicIncreaseProvider()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 8

Duplication

Lines 11
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 11
loc 11
rs 9.4285
cc 1
eloc 8
nc 1
nop 0
1
<?php
2
3
namespace Tests\COG\ChronoShifter\Period;
4
use COG\ChronoShifter\Period\IsoChronic;
5
6
/**
7
 * @author Kristjan Siimson <[email protected]>
8
 * @package Period\Test
9
 */
10
class IsoChronicTest extends \PHPUnit_Framework_TestCase
11
{
12
    /**
13
     * @dataProvider isoChronicBoundaryProvider
14
     * @param string $date
15
     * @param string $referenceDate
16
     * @param int $length
17
     * @param string $startDate
18
     * @param string $endDate
19
     */
20
    public function testIsoChronicBoundaries($date, $referenceDate, $length, $startDate, $endDate)
21
    {
22
        $isoChronic = new IsoChronic($date, $referenceDate, $length);
23
        $this->assertEquals($startDate, $isoChronic->getStartDate());
24
        $this->assertEquals($endDate, $isoChronic->getEndDate());
25
    }
26
27 View Code Duplication
    public function isoChronicBoundaryProvider()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
28
    {
29
        return array(
30
            array('2014-01-03', '2014-01-01', 2, '2014-01-03', '2014-01-04'),
31
            array('2014-01-02', '2014-01-01', 2, '2014-01-01', '2014-01-02'),
32
            array('2014-01-01', '2014-01-01', 2, '2014-01-01', '2014-01-02'),
33
            array('2013-12-31', '2014-01-01', 2, '2013-12-30', '2013-12-31'),
34
            array('2013-12-30', '2014-01-01', 2, '2013-12-30', '2013-12-31'),
35
            array('2013-12-29', '2014-01-01', 2, '2013-12-28', '2013-12-29')
36
        );
37
    }
38
39
    /**
40
     * @dataProvider isoChronicIncreaseProvider
41
     * @param string $date
42
     * @param string $referenceDate
43
     * @param int $length
44
     * @param string $startDate
45
     * @param string $endDate
46
     */
47
    public function testIsoChronicIncrease($date, $referenceDate, $length, $startDate, $endDate)
48
    {
49
        $isoChronic = new IsoChronic($date, $referenceDate, $length);
50
        $isoChronic->next();
51
        $this->assertEquals($startDate, $isoChronic->getStartDate());
52
        $this->assertEquals($endDate, $isoChronic->getEndDate());
53
    }
54
55 View Code Duplication
    public function isoChronicIncreaseProvider()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
56
    {
57
        return array(
58
            array('2014-01-03', '2014-01-01', 2, '2014-01-05', '2014-01-06'),
59
            array('2014-01-02', '2014-01-01', 2, '2014-01-03', '2014-01-04'),
60
            array('2014-01-01', '2014-01-01', 2, '2014-01-03', '2014-01-04'),
61
            array('2013-12-31', '2014-01-01', 2, '2014-01-01', '2014-01-02'),
62
            array('2013-12-30', '2014-01-01', 2, '2014-01-01', '2014-01-02'),
63
            array('2013-12-29', '2014-01-01', 2, '2013-12-30', '2013-12-31')
64
        );
65
    }
66
67
    /**
68
     * @dataProvider isoChronicDecreaseProvider
69
     * @param string $date
70
     * @param string $referenceDate
71
     * @param int $length
72
     * @param string $startDate
73
     * @param string $endDate
74
     */
75 View Code Duplication
    public function testIsoChronicDecrease($date, $referenceDate, $length, $startDate, $endDate)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
76
    {
77
        $isoChronic = new IsoChronic($date, $referenceDate, $length);
78
        $isoChronic->previous();
79
        $this->assertEquals($startDate, $isoChronic->getStartDate());
80
        $this->assertEquals($endDate, $isoChronic->getEndDate());
81
    }
82
83 View Code Duplication
    public function isoChronicDecreaseProvider()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
84
    {
85
        return array(
86
            array('2014-01-03', '2014-01-01', 2, '2014-01-01', '2014-01-02'),
87
            array('2014-01-02', '2014-01-01', 2, '2013-12-30', '2013-12-31'),
88
            array('2014-01-01', '2014-01-01', 2, '2013-12-30', '2013-12-31'),
89
            array('2013-12-31', '2014-01-01', 2, '2013-12-28', '2013-12-29'),
90
            array('2013-12-30', '2014-01-01', 2, '2013-12-28', '2013-12-29'),
91
            array('2013-12-29', '2014-01-01', 2, '2013-12-26', '2013-12-27')
92
        );
93
    }
94
}