Completed
Push — master ( e62357...459429 )
by Loïc
17s queued 11s
created

DashboardContext   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A iOpenAdministrationDashboard() 0 4 1
A iShouldSeeNewCustomersInTheList() 0 4 1
A iShouldSeeNewCustomers() 0 4 1
1
<?php
2
3
/*
4
 * This file is part of monofony.
5
 *
6
 * (c) Mobizel
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
declare(strict_types=1);
13
14
namespace App\Behat\Context\Ui\Backend;
15
16
use App\Behat\Page\Backend\DashboardPage;
17
use Behat\Behat\Context\Context;
18
use Webmozart\Assert\Assert;
19
20
class DashboardContext implements Context
21
{
22
    /** @var DashboardPage */
23
    private $dashboardPage;
24
25
    public function __construct(DashboardPage $dashboardPage)
26
    {
27
        $this->dashboardPage = $dashboardPage;
28
    }
29
30
    /**
31
     * @When I open administration dashboard
32
     */
33
    public function iOpenAdministrationDashboard()
34
    {
35
        $this->dashboardPage->open();
36
    }
37
38
    /**
39
     * @Then I should see :number new customers in the list
40
     */
41
    public function iShouldSeeNewCustomersInTheList($number)
42
    {
43
        Assert::same($this->dashboardPage->getNumberOfNewCustomersInTheList(), (int) $number);
44
    }
45
46
    /**
47
     * @Then I should see :number new customers
48
     */
49
    public function iShouldSeeNewCustomers($number)
50
    {
51
        Assert::same($this->dashboardPage->getNumberOfNewCustomers(), (int) $number);
52
    }
53
}
54