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
Pull Request — master (#26)
by Vincent
02:12
created

ArgumentsResolverTest::testResolve()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 22
Code Lines 18

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 22
rs 9.2
c 0
b 0
f 0
cc 1
eloc 18
nc 1
nop 0
1
<?php
2
3
/*
4
 * This file is part of the ScenarioStateBehatExtension project.
5
 *
6
 * (c) Rodrigue Villetard <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Gorghoa\ScenarioStateBehatExtension\Resolver;
13
14
use Doctrine\Common\Annotations\Reader;
15
use Gorghoa\ScenarioStateBehatExtension\Annotation\ScenarioStateArgument;
16
use Gorghoa\ScenarioStateBehatExtension\Context\Initializer\ScenarioStateInitializer;
17
use Gorghoa\ScenarioStateBehatExtension\ScenarioStateInterface;
18
19
/**
20
 * @author Vincent Chalamon <[email protected]>
21
 */
22
class ArgumentsResolverTest extends \PHPUnit_Framework_TestCase
23
{
24
    public function testResolve()
25
    {
26
        $initializerMock = $this->prophesize(ScenarioStateInitializer::class);
27
        $storeMock = $this->prophesize(ScenarioStateInterface::class);
28
        $readerMock = $this->prophesize(Reader::class);
29
        $functionMock = $this->prophesize(\ReflectionMethod::class);
30
        $parameterMock = $this->prophesize(\ReflectionParameter::class);
31
        $annotationMock = $this->prophesize(ScenarioStateArgument::class);
32
33
        $functionMock->getParameters()->willReturn([$parameterMock, $parameterMock])->shouldBeCalledTimes(2);
34
        $parameterMock->getName()->willReturn('lorem', 'foo', 'lorem', 'lorem', 'foo', 'foo')->shouldBeCalledTimes(6);
35
        $initializerMock->getStore()->willReturn($storeMock)->shouldBeCalledTimes(1);
36
        $readerMock->getMethodAnnotation($functionMock, ScenarioStateArgument::class)->willReturn($annotationMock)->shouldBeCalledTimes(1);
37
        $readerMock->getMethodAnnotations($functionMock)->willReturn([$this->prophesize(\stdClass::class), $annotationMock])->shouldBeCalledTimes(1);
38
        $annotationMock->getArgument()->willReturn('lorem')->shouldBeCalledTimes(2);
39
        $annotationMock->getName()->willReturn('ipsum')->shouldBeCalledTimes(2);
40
        $storeMock->hasStateFragment('ipsum')->willReturn(true)->shouldBeCalledTimes(1);
41
        $storeMock->getStateFragment('ipsum')->willReturn('pouet')->shouldBeCalledTimes(1);
42
43
        $resolver = new ArgumentsResolver($initializerMock->reveal(), $readerMock->reveal());
44
        $resolver->resolve($functionMock->reveal(), ['lorem' => 'pouet', 'foo' => 'bar']);
45
    }
46
}
47