Completed
Push — master ( bc0397...d70954 )
by Dmitry
03:38
created

IPAddressesCest::ensureICanSeeLegendBox()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10

Duplication

Lines 10
Ratio 100 %

Importance

Changes 0
Metric Value
dl 10
loc 10
rs 9.9332
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
/**
3
 * Hosting Plugin for HiPanel
4
 *
5
 * @link      https://github.com/hiqdev/hipanel-module-hosting
6
 * @package   hipanel-module-hosting
7
 * @license   BSD-3-Clause
8
 * @copyright Copyright (c) 2015-2019, HiQDev (http://hiqdev.com/)
9
 */
10
11
namespace hipanel\modules\hosting\tests\acceptance\client;
12
13
use hipanel\helpers\Url;
14
use hipanel\tests\_support\Page\IndexPage;
15
use hipanel\tests\_support\Page\Widget\Input\Input;
16
use hipanel\tests\_support\Page\Widget\Input\Select2;
17
use hipanel\tests\_support\Step\Acceptance\Client;
18
19 View Code Duplication
class IPAddressesCest
0 ignored issues
show
Duplication introduced by
This class 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...
20
{
21
    /**
22
     * @var IndexPage
23
     */
24
    private $index;
25
26
    public function _before(Client $I)
27
    {
28
        $this->index = new IndexPage($I);
29
    }
30
31
    public function ensureIndexPageWorks(Client $I)
32
    {
33
        $I->login();
34
        $I->needPage(Url::to('@ip'));
35
        $I->see('IP addresses', 'h1');
36
        $this->ensureICanSeeAdvancedSearchBox($I);
37
        $this->ensureICanSeeLegendBox();
0 ignored issues
show
Bug introduced by
The method ensureICanSeeLegendBox() does not seem to exist on object<hipanel\modules\h...client\IPAddressesCest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
38
        $this->ensureICanSeeBulkSearchBox();
39
    }
40
41
    private function ensureICanSeeAdvancedSearchBox(Client $I)
42
    {
43
        $this->index->containsFilters([
44
            Input::asAdvancedSearch($I, 'IPs'),
45
            Input::asAdvancedSearch($I, 'Servers'),
46
            Select2::asAdvancedSearch($I, 'Tags'),
47
        ]);
48
    }
49
50
    private function ensureICanSeeBulkSearchBox()
51
    {
52
        $this->index->containsColumns([
53
            'IP',
54
            'Counters',
55
            'Links',
56
        ]);
57
    }
58
}
59