Index::ensurePlanNotFound()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 11

Duplication

Lines 11
Ratio 100 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 11
loc 11
rs 9.9
cc 1
nc 1
nop 1
1
<?php
2
/**
3
 * Finance module for HiPanel
4
 *
5
 * @link      https://github.com/hiqdev/hipanel-module-finance
6
 * @package   hipanel-module-finance
7
 * @license   BSD-3-Clause
8
 * @copyright Copyright (c) 2015-2019, HiQDev (http://hiqdev.com/)
9
 */
10
11
namespace hipanel\modules\finance\tests\_support\Page\plan;
12
13
use hipanel\helpers\Url;
14
use hipanel\tests\_support\Page\Authenticated;
15
16
class Index extends Authenticated
17
{
18
    public function ensurePageWorks()
19
    {
20
        $I = $this->tester;
21
22
        $I->needPage(Url::to(['@plan']));
23
        $I->see('Tariff plans');
24
        $I->see('Advanced search');
25
        $I->seeLink('Create', Url::to(['@plan/create']));
26
        $I->seeElement('input', ['name' => 'PlanSearch[name_ilike]']);
27
28
        return $this;
29
    }
30
31 View Code Duplication
    public function ensurePlanCanBeFound($name)
0 ignored issues
show
Duplication introduced by pkolomiy
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
32
    {
33
        $I = $this->tester;
34
35
        $I->fillField(['name' => 'PlanSearch[name_ilike]'], $name);
36
        $I->click('Search');
37
        $I->waitForJS("return $('tbody tr td a.bold').length === 1;", 60);
38
        $I->see($name);
39
40
        return $this;
41
    }
42
43 View Code Duplication
    public function ensurePlanNotFound($name)
0 ignored issues
show
Duplication introduced by pkolomiy
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
44
    {
45
        $I = $this->tester;
46
47
        $I->fillField(['name' => 'PlanSearch[name_ilike]'], $name);
48
        $I->click('Search');
49
        $I->waitForJS("return $('tbody tr td a.bold').length === 0;", 60);
50
        $I->see('No results found.', '.empty');
51
52
        return $this;
53
    }
54
}
55