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 (#31)
by Rodrigue
01:53
created

ArgumentsResolverTest::testResolve()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 26
Code Lines 18

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 26
rs 8.8571
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 StepArgumentInjectorBehatExtension 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\StepArgumentInjectorBehatExtension\Resolver;
13
14
use Doctrine\Common\Annotations\Reader;
15
use Gorghoa\StepArgumentInjectorBehatExtension\Annotation\StepInjectorArgument;
16
use Gorghoa\StepArgumentInjectorBehatExtension\Argument\StepArgumentHolder;
17
18
/**
19
 * @author Vincent Chalamon <[email protected]>
20
 * @author Rodrigue Villetard <[email protected]>
21
 */
22
class ArgumentsResolverTest extends \PHPUnit_Framework_TestCase
23
{
24
    public function testResolve()
25
    {
26
        $readerMock = $this->prophesize(Reader::class);
27
        $functionMock = $this->prophesize(\ReflectionMethod::class);
28
        $parameterMock = $this->prophesize(\ReflectionParameter::class);
29
        $annotationMock = $this->prophesize(StepInjectorArgument::class);
30
31
        $functionMock->getParameters()->willReturn([$parameterMock, $parameterMock])->shouldBeCalledTimes(2);
32
        $parameterMock->getName()->willReturn('lorem', 'foo', 'lorem', 'foo')->shouldBeCalledTimes(4);
33
34
        $holderMock1 = $this->prophesize(StepArgumentHolder::class);
35
        $holderMock2 = $this->prophesize(StepArgumentHolder::class);
36
37
        $readerMock->getMethodAnnotation($functionMock, StepInjectorArgument::class)->willReturn($annotationMock)->shouldBeCalledTimes(1);
38
        $readerMock->getMethodAnnotations($functionMock)->willReturn([$this->prophesize(\stdClass::class), $annotationMock])->shouldBeCalledTimes(1);
39
        $annotationMock->getArgument()->willReturn('lorem')->shouldBeCalledTimes(1);
40
41
        $holderMock1->doesHandleStepArgument($annotationMock)->willReturn(true)->shouldBeCalledTimes(1);
42
        $holderMock1->getStepArgumentValueFor($annotationMock)->willReturn(true)->shouldBeCalledTimes(1);
43
44
        $holderMock2->doesHandleStepArgument($annotationMock)->willReturn(false)->shouldBeCalledTimes(1);
45
        $holderMock2->getStepArgumentValueFor($annotationMock)->shouldNotBeCalled();
46
47
        $resolver = new ArgumentsResolver([$holderMock1->reveal(), $holderMock2->reveal()], $readerMock->reveal());
48
        $resolver->resolve($functionMock->reveal(), ['lorem' => 'pouet', 'foo' => 'bar']);
49
    }
50
}
51