Completed
Push — master ( 22512f...2e0539 )
by Kamil
24:53
created

CartContext   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A myCartTotalShouldBe() 0 8 1
A myCartTaxesShouldBe() 0 8 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;
13
14
use Sylius\Behat\Context\FeatureContext;
15
use Sylius\Behat\Page\Cart\CartSummaryPage;
16
17
/**
18
 * @author Mateusz Zalewski <[email protected]>
19
 */
20
class CartContext extends FeatureContext
21
{
22
    /**
23
     * @Then /^my cart total should be "([^"]*)"$/
24
     */
25
    public function myCartTotalShouldBe($total)
26
    {
27
        /** @var CartSummaryPage $cartSummaryPage */
28
        $cartSummaryPage = $this->getPage('Cart\CartSummaryPage');
29
        $cartSummaryPage->open();
30
31
        $this->assertSession()->elementTextContains('css', '#cart-summary', 'Grand total: '.$total);
32
    }
33
34
    /**
35
     * @Given /^my cart taxes should be "([^"]*)"$/
36
     */
37
    public function myCartTaxesShouldBe($taxesTotal)
38
    {
39
        /** @var CartSummaryPage $cartSummaryPage */
40
        $cartSummaryPage = $this->getPage('Cart\CartSummaryPage');
41
        $cartSummaryPage->open();
42
43
        $this->assertSession()->elementTextContains('css', '#cart-summary', 'Tax total: '.$taxesTotal);
44
    }
45
}
46