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.
Passed
Push — master ( 3fb9ca...8cc1d2 )
by Kristjan
03:55 queued 54s
created

InnerShifterTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 5

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 3
c 1
b 0
f 1
lcom 1
cbo 5
dl 0
loc 38
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A testCurrentValuePassesValueFromInnerShifterToOuterShifter() 0 12 1
A testNextReturnsValueFromOuterShifter() 0 11 1
A mockShifter() 0 7 1
1
<?php
2
3
namespace Tests\COG\Iterator\InnerShifter;
4
5
use COG\ChronoShifter\Iterator\InnerChronoIterator;
6
7
/**
8
 * @author Kristjan Siimson <[email protected]>
9
 * @package Iterator\Test
10
 */
11
class InnerShifterTest extends \PHPUnit_Framework_TestCase
12
{
13
    public function testCurrentValuePassesValueFromInnerShifterToOuterShifter()
14
    {
15
        $innerShifter = $this->mockShifter();
16
        $innerShifter->expects($this->any())->method('shift')->will($this->returnValue('2015-01-02'));
17
18
        $outerShifter = $this->mockShifter();
19
        $outerShifter->expects($this->once())->method('shift')->with('2015-01-02');
20
21
        $iterator = new InnerChronoIterator($innerShifter, $outerShifter, '2011-11-11');
22
        $iterator->next();
23
        $iterator->current();
24
    }
25
26
    public function testNextReturnsValueFromOuterShifter()
27
    {
28
        $innerShifter = $this->mockShifter();
29
30
        $outerShifter = $this->mockShifter();
31
        $outerShifter->expects($this->once())->method('shift')->will($this->returnValue('2015-02-02'));
32
33
        $iterator = new InnerChronoIterator($innerShifter, $outerShifter, '2011-11-11');
34
        $iterator->next();
35
        $this->assertEquals('2015-02-02', $iterator->current());
36
    }
37
38
    /**
39
     * @return \PHPUnit_Framework_MockObject_MockObject
40
     */
41
    private function mockShifter()
42
    {
43
        return $this
44
            ->getMockBuilder('COG\ChronoShifter\Shifter\Shifter')
45
            ->setMethods(array('shift'))
46
            ->getMockForAbstractClass();
47
    }
48
}
49