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.
Completed
Push — master ( aa4ff3...5266c0 )
by Alex
22:35
created

Tests/Action/ExecutorTest.php (1 issue)

Severity

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
/**
3
 * This file is part of the Global Trading Technologies Ltd workflow-extension-bundle package.
4
 *
5
 * For the full copyright and license information, please view the LICENSE
6
 * file that was distributed with this source code.
7
 *
8
 * (c) fduch <[email protected]>
9
 *
10
 * Date: 19.10.16
11
 */
12
13
namespace Gtt\Bundle\WorkflowExtensionsBundle\Tests\Action;
14
15
use Gtt\Bundle\WorkflowExtensionsBundle\Action\Executor;
16
use Gtt\Bundle\WorkflowExtensionsBundle\Action\Reference\ActionReferenceInterface;
17
use Gtt\Bundle\WorkflowExtensionsBundle\Action\Registry;
18
use Gtt\Bundle\WorkflowExtensionsBundle\Tests\Action\Reference\ContainerAwareActionReferenceInterface;
19
use Gtt\Bundle\WorkflowExtensionsBundle\WorkflowContext;
20
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
21
use Symfony\Component\DependencyInjection\ContainerInterface;
22
use Symfony\Component\Workflow\Workflow;
23
24
class ExecutorTest extends \PHPUnit_Framework_TestCase
25
{
26
    /**
27
     * @dataProvider actionReferenceProvider
28
     */
29
    public function testEvaluatesAction($actionReferenceClass, $actionReferenceType, $inputArgs, $expectedArgs, WorkflowContext $wc)
0 ignored issues
show
The parameter $actionReferenceClass is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
30
    {
31
        $container = $this->getMock(ContainerInterface::class);
32
33
        $actionName = 'a1';
34
        $actionReference = $this->getMockBuilder(ActionReferenceInterface::class)->disableOriginalConstructor()->getMock();
35
        $actionReference->expects(self::once())->method('invoke')->with($expectedArgs);
36
        $actionReference->expects(self::once())->method('getType')->willReturn($actionReferenceType);
37
38
        $actionRegistry = $this->getMock(Registry::class);
39
        $actionRegistry->expects(self::once())->method('get')->with(self::equalTo($actionName))->willReturn($actionReference);
40
41
        $executor = new Executor($actionRegistry, $container);
42
        $executor->execute($wc, $actionName, $inputArgs);
43
    }
44
45
    public function actionReferenceProvider()
46
    {
47
        $data = [];
48
49
        $workflowContext = new WorkflowContext(
50
            $this->getMockBuilder(Workflow::class)->disableOriginalConstructor()->getMock(),
51
            new \StdClass(),
52
            1
53
        );
54
55
        $defaultInputActionArgs = ['some' => 'arg', 'more'];
56
57
        // regular action (non-container-aware)
58
        $data[] = [ActionReferenceInterface::class, ActionReferenceInterface::TYPE_REGULAR, $defaultInputActionArgs, $defaultInputActionArgs, $workflowContext];
59
60
        // regular action (container-aware)
61
        $data[] = [ContainerAwareActionReferenceInterface::class, ActionReferenceInterface::TYPE_REGULAR, $defaultInputActionArgs, $defaultInputActionArgs, $workflowContext];
62
63
        $workflowActionInputArgs = $defaultInputActionArgs;
64
        array_unshift($workflowActionInputArgs, $workflowContext);
65
66
        // workflow action (non-container-aware)
67
        $data[] = [ActionReferenceInterface::class, ActionReferenceInterface::TYPE_WORKFLOW, $defaultInputActionArgs, $workflowActionInputArgs, $workflowContext];
68
69
        // workflow action (container-aware)
70
        $data[] = [ContainerAwareActionReferenceInterface::class, ActionReferenceInterface::TYPE_WORKFLOW, $defaultInputActionArgs, $workflowActionInputArgs, $workflowContext];
71
72
        return $data;
73
    }
74
}
75