Code Duplication    Length = 41-42 lines in 3 locations

tests/acceptance/admin/CronsCest.php 1 location

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

tests/acceptance/client/ServicesCest.php 1 location

@@ 19-60 (lines=42) @@
16
use hipanel\tests\_support\Page\Widget\Input\Select2;
17
use hipanel\tests\_support\Step\Acceptance\Client;
18
19
class ServicesCest
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('@service'));
35
        $I->see('Services', 'h1');
36
        $this->ensureICanSeeAdvancedSearchBox($I);
37
        $this->ensureICanSeeBulkSearchBox();
38
    }
39
40
    private function ensureICanSeeAdvancedSearchBox(Client $I)
41
    {
42
        $this->index->containsFilters([
43
            Input::asAdvancedSearch($I, 'Name'),
44
            Select2::asAdvancedSearch($I, 'Server'),
45
            Select2::asAdvancedSearch($I, 'Soft'),
46
            Select2::asAdvancedSearch($I, 'Status'),
47
        ]);
48
    }
49
50
    private function ensureICanSeeBulkSearchBox()
51
    {
52
        $this->index->containsColumns([
53
            'Server',
54
            'Object',
55
            'IP',
56
            'Soft',
57
            'Status',
58
        ]);
59
    }
60
}
61

tests/acceptance/seller/CronsCest.php 1 location

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