Completed
Push — 3.8.x ( 9386e4...de6774 )
by Tim
05:29
created

thePageShouldContainThePrice()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 13

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 13
c 0
b 0
f 0
rs 9.8333
cc 2
nc 2
nop 2
1
<?php
2
3
/**
4
 * Defines application features from the specific context.
5
 */
6
class ProductFeatureContext extends FeatureContext
7
{
8
9
    /**
10
     * @Then the page :arg1 should return status :arg2
11
     */
12
    public function thePageShouldReturnStatus($arg1, $arg2)
13
    {
14
15
        $this->visitPath($arg1);
16
17
        PHPUnit_Framework_Assert::assertSame((integer) $arg2, $this->getSession()->getStatusCode());
18
    }
19
20
    /**
21
     * @Then the page :arg1 should return status :arg2 has title :arg3 and contain price :arg4
22
     */
23
    public function thePageShouldReturnStatusHasTitleAndContainPrice($arg1, $arg2, $arg3, $arg4)
24
    {
25
26
        $this->visitPath($arg1);
27
28
        PHPUnit_Framework_Assert::assertSame((integer) $arg2, $this->getSession()->getStatusCode());
29
30
        /** @var \Behat\Mink\Element\NodeElement $title */
31
        $title = $this->getSession()->getPage()->find('css', 'title');
32
        PHPUnit_Framework_Assert::assertSame($arg3, $title->getText());
33
34
        /** @var \Behat\Mink\Element\NodeElement $price */
35
        $price = $this->getSession()->getPage()->find('xpath', '//*[@class="price"]');
36
        PHPUnit_Framework_Assert::assertSame($arg4, $price->getText());
37
    }
38
}
39