Completed
Push — master ( d54afb...01173a )
by Kamil
26:45
created

DashboardContext::iShouldSeeNewCustomers()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
/*
4
 * This file is part of the Sylius package.
5
 *
6
 * (c) Paweł Jędrzejewski
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 Sylius\Behat\Context\Ui\Admin;
13
14
use Behat\Behat\Context\Context;
15
use Sylius\Behat\Page\Admin\DashboardPageInterface;
16
use Webmozart\Assert\Assert;
17
18
/**
19
 * @author Paweł Jędrzejewski <[email protected]>
20
 */
21
final class DashboardContext implements Context
22
{
23
    /**
24
     * @var DashboardPageInterface
25
     */
26
    private $dashboardPage;
27
28
    /**
29
     * @param DashboardPageInterface $dashboardPage
30
     */
31
    public function __construct(DashboardPageInterface $dashboardPage)
32
    {
33
        $this->dashboardPage = $dashboardPage;
34
    }
35
36
    /**
37
     * @When I open administration dashboard
38
     */
39
    public function iOpenAdministrationDashboard()
40
    {
41
        $this->dashboardPage->open();
42
    }
43
44
    /**
45
     * @Then I should see :number new orders
46
     */
47
    public function iShouldSeeNewOrders($number)
48
    {
49
        Assert::same($this->dashboardPage->getNumberOfNewOrders(), $number);
50
    }
51
52
    /**
53
     * @Then I should see :number new customers
54
     */
55
    public function iShouldSeeNewCustomers($number)
56
    {
57
        Assert::same($this->dashboardPage->getNumberOfNewCustomers(), $number);
58
    }
59
60
    /**
61
     * @Then there should be total sales of :total
62
     */
63
    public function thereShouldBeTotalSalesOf($total)
64
    {
65
        Assert::same($this->dashboardPage->getTotalSales(), $total);
66
    }
67
68
    /**
69
     * @Then the average order value should be :value
70
     */
71
    public function myAverageOrderValueShouldBe($value)
72
    {
73
        Assert::same($this->dashboardPage->getAverageOrderValue(), $value);
74
    }
75
76
    /**
77
     * @Then I should see :number customers in the list
78
     */
79
    public function iShouldSeeCustomersInTheList2($number)
80
    {
81
        Assert::same($this->dashboardPage->getNumberOfNewCustomersInTheList(), $number);
82
    }
83
84
    /**
85
     * @Then I should see :number new orders in the list
86
     */
87
    public function iShouldSeeNewOrdersInTheList($number)
88
    {
89
        Assert::same($this->dashboardPage->getNumberOfNewOrdersInTheList(), $number);
90
    }
91
}
92