Completed
Push — master ( 1e1c60...9bcebd )
by Dmitry
05:09 queued 03:01
created

DashboardSearchBox::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
namespace hipanel\tests\_support\DashboardHelper;
4
5
use hipanel\tests\_support\AcceptanceTester;
6
7
class DashboardSearchBox
8
{
9
    /**
10
     * @var AcceptanceTester
11
     */
12
    protected $tester;
13
14
    /**
15
     * DashboardSearchBox constructor.
16
     * @param AcceptanceTester $tester
17
     */
18
    public function __construct(AcceptanceTester $tester)
19
    {
20
        $this->tester = $tester;
21
    }
22
23
    /**
24
     * Ensure is search box contains on testing page
25
     * @param string $formAction
26
     * @param string $inputName
27
     * @param string $typeInput
28
     */
29
    public function ensureSearchBoxContains(
30
        string $formAction,
31
        string $inputName,
32
        string $typeInput
33
    ): void
34
    {
35
        $I = $this->tester;
36
        $formActionXpath = "//form[contains(@action,'" . $formAction . "')]";
37
        $input = $formActionXpath . "//". $typeInput . "[contains(@name, '$inputName')]";
38
39
        $I->seeInCurrentUrl('/dashboard/dashboard');
40
        $I->seeElement($formAction);
41
        $I->seeElement($input);
42
    }
43
}
44