Completed
Push — 3.8.x ( de6774...12ed2a )
by Tim
06:50
created

ProductFeatureContext   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 5

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 5
dl 0
loc 41
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A isOnOurPage() 0 3 1
A heIsOn() 0 4 1
A thePageShouldReturnStatus2() 0 4 1
A hasTitleAndContainPrice() 0 11 1
1
<?php
2
3
/**
4
 * Defines application features from the specific context.
5
 */
6
class ProductFeatureContext extends FeatureContext
7
{
8
9
    /**
10
     * @Given is on our page
11
     */
12
    public function isOnOurPage()
13
    {
14
    }
15
16
    /**
17
     * @When he is on :arg1
18
     */
19
    public function heIsOn($arg1)
20
    {
21
        $this->visitPath($arg1);
22
    }
23
24
    /**
25
     * @Then the page should return status :arg1
26
     */
27
    public function thePageShouldReturnStatus2($arg1)
28
    {
29
        PHPUnit_Framework_Assert::assertSame((integer) $arg1, $this->getSession()->getStatusCode());
30
    }
31
32
    /**
33
     * @Then has title :arg1 and contain price :arg2
34
     */
35
    public function hasTitleAndContainPrice($arg1, $arg2)
36
    {
37
38
        /** @var \Behat\Mink\Element\NodeElement $title */
39
        $title = $this->getSession()->getPage()->find('css', 'title');
40
        PHPUnit_Framework_Assert::assertSame($arg1, $title->getText());
41
42
        /** @var \Behat\Mink\Element\NodeElement $price */
43
        $price = $this->getSession()->getPage()->find('xpath', '//*[@class="price"]');
44
        PHPUnit_Framework_Assert::assertSame($arg2, $price->getText());
45
    }
46
}
47