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 ( 228e27...d5b0c7 )
by Kevin
05:38 queued 02:51
created

Cancel   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 7

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 1
cbo 7
dl 0
loc 45
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 16 1
A execute() 0 10 1
1
<?php
2
3
namespace Magium\Magento\Actions\Admin\Orders;
4
5
use Magium\AbstractTestCase;
6
use Magium\Actions\StaticActionInterface;
7
use Magium\Actions\SubAction\SubActionInterface;
8
use Magium\Actions\SubAction\SubActionSupported;
9
use Magium\Assertions\Xpath\Displayed;
10
use Magium\Magento\Actions\Admin\WaitForPageLoaded;
11
use Magium\Magento\Actions\Admin\Widget\ClickActionButton;
12
use Magium\Magento\Themes\Admin\ThemeConfiguration;
13
use Magium\WebDriver\WebDriver;
14
15
class Cancel implements StaticActionInterface
16
{
17
18
    const ACTION = 'Admin\Orders\Cancel';
19
20
    protected $webDriver;
21
    protected $themeConfiguration;
22
    protected $actionButton;
23
    protected $loaded;
24
    protected $testCase;
25
    protected $displayed;
26
27
    public function __construct(
28
        WebDriver $webDriver,
29
        ThemeConfiguration $themeConfiguration,
30
        ClickActionButton $actionButton,
31
        WaitForPageLoaded $loaded,
32
        AbstractTestCase $testCase,
33
        Displayed $displayed
34
    )
35
    {
36
        $this->webDriver = $webDriver;
37
        $this->themeConfiguration = $themeConfiguration;
38
        $this->actionButton = $actionButton;
39
        $this->loaded = $loaded;
40
        $this->testCase = $testCase;
41
        $this->displayed = $displayed;
42
    }
43
44
    /**
45
     * This test presumes that you are on the order screen
46
     */
47
48
    public function execute()
49
    {
50
        $body = $this->webDriver->byXpath('//body');
51
        $this->actionButton->click('Cancel');
52
        $this->webDriver->switchTo()->alert()->accept();
53
        $this->loaded->execute($body);
54
55
        $xpath = $this->themeConfiguration->getOrderCancelledMessageXpath();
56
        $this->displayed->assertSelector($xpath);
57
    }
58
59
}
60