Code Duplication    Length = 41-42 lines in 3 locations

tests/acceptance/admin/CronsCest.php 1 location

@@ 10-50 (lines=41) @@
7
use hipanel\tests\_support\Page\Widget\Input\Select2;
8
use hipanel\tests\_support\Step\Acceptance\Admin;
9
10
class CronsCest
11
{
12
    /**
13
     * @var IndexPage
14
     */
15
    private $index;
16
17
    public function _before(Admin $I)
18
    {
19
        $this->index = new IndexPage($I);
20
    }
21
22
    public function ensureIndexPageWorks(Admin $I)
23
    {
24
        $I->login();
25
        $I->needPage(Url::to('@crontab'));
26
        $I->see('Crons', 'h1');
27
        $this->ensureICanSeeAdvancedSearchBox($I);
28
        $this->ensureICanSeeBulkSearchBox();
29
    }
30
31
    private function ensureICanSeeAdvancedSearchBox(Admin $I)
32
    {
33
        $this->index->containsFilters([
34
            Select2::asAdvancedSearch($I, 'Account'),
35
            Select2::asAdvancedSearch($I, 'Server'),
36
            Select2::asAdvancedSearch($I, 'Client'),
37
        ]);
38
    }
39
40
    private function ensureICanSeeBulkSearchBox()
41
    {
42
        $this->index->containsColumns([
43
            'Crontab',
44
            'Account',
45
            'Server',
46
            'Client',
47
            'Status',
48
        ]);
49
    }
50
}
51

tests/acceptance/client/ServicesCest.php 1 location

@@ 11-52 (lines=42) @@
8
use hipanel\tests\_support\Page\Widget\Input\Select2;
9
use hipanel\tests\_support\Step\Acceptance\Client;
10
11
class ServicesCest
12
{
13
    /**
14
     * @var IndexPage
15
     */
16
    private $index;
17
18
    public function _before(Client $I)
19
    {
20
        $this->index = new IndexPage($I);
21
    }
22
23
    public function ensureIndexPageWorks(Client $I)
24
    {
25
        $I->login();
26
        $I->needPage(Url::to('@service'));
27
        $I->see('Services', 'h1');
28
        $this->ensureICanSeeAdvancedSearchBox($I);
29
        $this->ensureICanSeeBulkSearchBox();
30
    }
31
32
    private function ensureICanSeeAdvancedSearchBox(Client $I)
33
    {
34
        $this->index->containsFilters([
35
            Input::asAdvancedSearch($I, 'Name'),
36
            Select2::asAdvancedSearch($I, 'Server'),
37
            Select2::asAdvancedSearch($I, 'Soft'),
38
            Select2::asAdvancedSearch($I, 'Status'),
39
        ]);
40
    }
41
42
    private function ensureICanSeeBulkSearchBox()
43
    {
44
        $this->index->containsColumns([
45
            'Server',
46
            'Object',
47
            'IP',
48
            'Soft',
49
            'Status',
50
        ]);
51
    }
52
}
53

tests/acceptance/seller/CronsCest.php 1 location

@@ 10-50 (lines=41) @@
7
use hipanel\tests\_support\Page\Widget\Input\Select2;
8
use hipanel\tests\_support\Step\Acceptance\Seller;
9
10
class CronsCest
11
{
12
    /**
13
     * @var IndexPage
14
     */
15
    private $index;
16
17
    public function _before(Seller $I)
18
    {
19
        $this->index = new IndexPage($I);
20
    }
21
22
    public function ensureIndexPageWorks(Seller $I)
23
    {
24
        $I->login();
25
        $I->needPage(Url::to('@crontab'));
26
        $I->see('Crons', 'h1');
27
        $this->ensureICanSeeAdvancedSearchBox($I);
28
        $this->ensureICanSeeBulkSearchBox();
29
    }
30
31
    private function ensureICanSeeAdvancedSearchBox(Seller $I)
32
    {
33
        $this->index->containsFilters([
34
            Select2::asAdvancedSearch($I, 'Account'),
35
            Select2::asAdvancedSearch($I, 'Server'),
36
            Select2::asAdvancedSearch($I, 'Client'),
37
        ]);
38
    }
39
40
    private function ensureICanSeeBulkSearchBox()
41
    {
42
        $this->index->containsColumns([
43
            'Crontab',
44
            'Account',
45
            'Server',
46
            'Client',
47
            'Status',
48
        ]);
49
    }
50
}
51