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.

EventTriggerWithGuardsCaseTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 62
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 5

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 5
dl 0
loc 62
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 15 1
B testSimple() 0 30 1
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
 * @date 29.06.16
10
 */
11
12
namespace Gtt\Bundle\WorkflowExtensionsBundle\Tests\Functional;
13
14
use Gtt\Bundle\WorkflowExtensionsBundle\Tests\Functional\Configuration\EventTriggerWithGuardsCase\Fixtures\Event;
15
use Gtt\Bundle\WorkflowExtensionsBundle\Tests\Functional\Configuration\EventTriggerWithGuardsCase\Fixtures\TargetWorkflowSubject;
16
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
17
18
class EventTriggerWithGuardsCaseTest extends TestCase
19
{
20
    /**
21
     * WebClient emulator
22
     *
23
     * @var \Symfony\Bundle\FrameworkBundle\Client
24
     */
25
    protected $client;
26
27
    /**
28
     * {@inheritdoc}
29
     */
30
    public function setUp()
31
    {
32
        parent::setUp();
33
34
        $this->client = $this->createClient(
35
            array(
36
                "app_name" => "EventTriggerWithGuardsCaseTest",
37
                "test_case" => "EventTriggerWithGuardsCase",
38
                "root_config" => "config.yml",
39
                "config_dir" => __DIR__ . "/Configuration",
40
                "environment" => "test",
41
                "debug" => false
42
            )
43
        );
44
    }
45
46
    /**
47
     * @group functional
48
     */
49
    public function testSimple()
50
    {
51
        $container = $this->client->getContainer();
52
        /** @var EventDispatcherInterface $eventDispatcher */
53
        $eventDispatcher = $container->get('event_dispatcher');
54
        
55
        $subject = new TargetWorkflowSubject();
56
        $event = new Event($subject);
57
        
58
        $eventDispatcher->dispatch('processing.event', $event);
59
        self::assertEquals(['processing' => 1], $subject->getStatus());
60
61
        $eventDispatcher->dispatch('processing.event', $event);
62
        self::assertEquals(['active' => 1, "regular" => 1], $subject->getStatus());
63
64
        $eventDispatcher->dispatch('viping.event', $event);
65
        self::assertEquals(['active' => 1, 'vip' => 1], $subject->getStatus());
66
67
        $eventDispatcher->dispatch('processing.event', $event);
68
        // nothing happens
69
        self::assertEquals(['active' => 1, 'vip' => 1], $subject->getStatus());
70
71
        $eventDispatcher->dispatch('viping.event', $event);
72
        // guard prevents closing vips
73
        self::assertEquals(['active' => 1, 'vip' => 1], $subject->getStatus());
74
75
        $eventDispatcher->dispatch('crazy_closing.event', $event);
76
        // guard allows closing only if there is only one place "active" in marking
77
        self::assertEquals(['active' => 1, 'vip' => 1], $subject->getStatus());
78
    }
79
}