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.

MonthlyLastDayOfWeekIncrementTest::testShift()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 15
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 5
Bugs 1 Features 0
Metric Value
c 5
b 1
f 0
dl 0
loc 15
rs 9.4285
cc 1
eloc 10
nc 1
nop 3
1
<?php
2
3
namespace Tests\COG\ChronoShifter\Shifter;
4
5
use COG\ChronoShifter\Direction\Increasing;
6
use COG\ChronoShifter\Evaluator\DayOfWeek;
7
use COG\ChronoShifter\Period\Month;
8
use COG\ChronoShifter\Selector\LastOf;
9
use COG\ChronoShifter\Shifter\ChronoShifter;
10
11
/**
12
 * @author Kristjan Siimson <[email protected]>
13
 * @package Shifter\Test
14
 */
15
class MonthlyLastDayOfWeekIncrementTest extends \PHPUnit_Framework_TestCase
16
{
17
    /**
18
     * @var array
19
     */
20
    private $fixture = array(
21
22
        array(
23
            1, // Monday
24
            '2015-06-02', // Starting time
25
            '2015-06-29'  // Expected time
26
        ),
27
28
        array(
29
            1, // Monday
30
            '2015-06-02 15:12:24', // Starting time
31
            '2015-06-29'  // Expected time
32
        ),
33
34
        array(
35
            7, // Sunday
36
            '2015-06-29 15:12:24', // Starting time
37
            '2015-07-26'  // Expected time
38
        ),
39
40
        array(
41
            5, // Friday
42
            '2015-06-15', // Starting time
43
            '2015-06-26'  // Expected time
44
        ),
45
46
        // Day of week is also last day of month
47
48
        array(
49
            2, // Tuesday
50
            '2016-05-06', // Starting time
51
            '2016-05-31'
52
        )
53
54
    );
55
56
    /**
57
     * @dataProvider shiftProvider
58
     * @param integer $day
59
     * @param string $start
60
     * @param string $expected
61
     */
62
    public function testShift($day, $start, $expected)
63
    {
64
        $shifter = new ChronoShifter(new Month($start), new LastOf(new Increasing(), new DayOfWeek($day)));
65
        $result = $shifter->shift($start);
66
67
        $this->assertEquals(
68
            $expected,
69
            $result,
70
            sprintf(
71
                'From %s to next last week day of month = %d',
72
                $start,
73
                $day
74
            )
75
        );
76
    }
77
78
    /**
79
     * @return array
80
     */
81
    public function shiftProvider()
82
    {
83
        return $this->fixture;
84
    }
85
}
86