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
04:07
created

SpecificTest::testCapNumberToDaysInPeriod()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 8
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 8
loc 8
rs 9.4285
cc 1
eloc 5
nc 1
nop 0
1
<?php
2
3
namespace Tests\COG\ChronoShifter\Period;
4
5
use COG\ChronoShifter\Direction\Decreasing;
6
use COG\ChronoShifter\Direction\Direction;
7
use COG\ChronoShifter\Direction\Increasing;
8
use COG\ChronoShifter\Period\Month;
9
use COG\ChronoShifter\Selector\Specific;
10
11
/**
12
 * @author Kristjan Siimson <[email protected]>
13
 * @package Selector\Test
14
 */
15
class SpecificTest extends \PHPUnit_Framework_TestCase
16
{
17 View Code Duplication
    public function testIfUpcomingMatchFoundUseCurrentPeriod()
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...
18
    {
19
        $selector = new Specific(new Increasing(), 15);
20
21
        $date = '2014-02-05';
22
        $period = new Month($date);
23
        $this->assertEquals('2014-02-15', $selector->select($date, $period));
24
    }
25
26 View Code Duplication
    public function testIfNoUpcomingMatchFoundUseNextPeriod()
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...
27
    {
28
        $selector = new Specific(new Increasing(), 15);
29
30
        $date = '2014-02-25';
31
        $period = new Month($date);
32
        $this->assertEquals('2014-03-15', $selector->select($date, $period));
33
    }
34
35 View Code Duplication
    public function testIfNoUpcomingMatchFoundUsePreviousPeriod()
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...
36
    {
37
        $selector = new Specific(new Decreasing(), 15);
38
39
        $date = '2014-02-05';
40
        $period = new Month($date);
41
        $this->assertEquals('2014-01-15', $selector->select($date, $period));
42
    }
43
44 View Code Duplication
    public function testCapNumberToDaysInPeriod()
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...
45
    {
46
        $selector = new Specific(new Increasing(), 31);
47
        
48
        $date = '2015-02-01';
49
        $period = new Month($date);
50
        $this->assertEquals('2015-02-28', $selector->select($date, $period));
51
    }
52
53
    /**
54
     * @expectedException \InvalidArgumentException
55
     */
56
    public function testInvalidArgumentWillThrowException()
57
    {
58
        new Specific($this->getMockForAbstractClass('COG\ChronoShifter\Direction\Direction'), '1.5');
59
    }
60
61
    /**
62
     * @expectedException \OutOfBoundsException
63
     * @uses Direction
64
     */
65
    public function testBelowOneDayWillThrowException()
66
    {
67
        new Specific($this->getMockForAbstractClass('COG\ChronoShifter\Direction\Direction'), 0);
68
    }
69
}
70