Code Duplication    Length = 61-61 lines in 3 locations

tests/acceptance/admin/DomainsCest.php 1 location

@@ 11-71 (lines=61) @@
8
use hipanel\tests\_support\Page\Widget\Input\Select2;
9
use hipanel\tests\_support\Step\Acceptance\Admin;
10
11
class DomainsCest
12
{
13
    /**
14
     * @var IndexPage
15
     */
16
    private $index;
17
18
    public function _before(Admin $I)
19
    {
20
        $this->index = new IndexPage($I);
21
    }
22
23
    public function ensureIndexPageWorks(Admin $I)
24
    {
25
        $I->login();
26
        $I->needPage(Url::to('@hdomain'));
27
        $I->see('Domains', 'h1');
28
        $I->see('Create domain', 'a');
29
        $this->ensureICanSeeAdvancedSearchBox();
30
        $this->ensureICanSeeLegendBox();
31
        $this->ensureICanSeeBulkSearchBox();
32
    }
33
34
    private function ensureICanSeeAdvancedSearchBox()
35
    {
36
        $this->index->containsFilters([
37
            new Input('Domain name'),
38
            new Input('Domain list (comma-separated)'),
39
            new Input('IP'),
40
            new Select2('Status'),
41
            new Select2('Show aliases only'),
42
            new Select2('Server'),
43
        ]);
44
    }
45
46
    private function ensureICanSeeLegendBox()
47
    {
48
        $this->index->containsLegend([
49
            'Domain',
50
            'DNS records',
51
            'Alias',
52
            'Name server',
53
            'Complex domain',
54
        ]);
55
    }
56
57
    private function ensureICanSeeBulkSearchBox()
58
    {
59
        $this->index->containsBulkButtons([
60
            'Delete',
61
        ]);
62
        $this->index->containsColumns([
63
            'Domain name',
64
            'Account',
65
            'Server',
66
            'Status',
67
            'IP',
68
            'Service',
69
        ]);
70
    }
71
}
72

tests/acceptance/client/DomainsCest.php 1 location

@@ 11-71 (lines=61) @@
8
use hipanel\tests\_support\Page\Widget\Input\Select2;
9
use hipanel\tests\_support\Step\Acceptance\Client;
10
11
class DomainsCest
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('@hdomain'));
27
        $I->see('Domains', 'h1');
28
        $I->see('Create domain', 'a');
29
        $this->ensureICanSeeAdvancedSearchBox();
30
        $this->ensureICanSeeLegendBox();
31
        $this->ensureICanSeeBulkSearchBox();
32
    }
33
34
    private function ensureICanSeeAdvancedSearchBox()
35
    {
36
        $this->index->containsFilters([
37
            new Input('Domain name'),
38
            new Input('Domain list (comma-separated)'),
39
            new Input('IP'),
40
            new Select2('Status'),
41
            new Select2('Show aliases only'),
42
            new Select2('Server'),
43
        ]);
44
    }
45
46
    private function ensureICanSeeLegendBox()
47
    {
48
        $this->index->containsLegend([
49
            'Domain',
50
            'DNS records',
51
            'Alias',
52
            'Name server',
53
            'Complex domain',
54
        ]);
55
    }
56
57
    private function ensureICanSeeBulkSearchBox()
58
    {
59
        $this->index->containsBulkButtons([
60
            'Delete',
61
        ]);
62
        $this->index->containsColumns([
63
            'Domain name',
64
            'Account',
65
            'Server',
66
            'Status',
67
            'IP',
68
            'Service',
69
        ]);
70
    }
71
}
72

tests/acceptance/seller/DomainsCest.php 1 location

@@ 11-71 (lines=61) @@
8
use hipanel\tests\_support\Page\Widget\Input\Select2;
9
use hipanel\tests\_support\Step\Acceptance\Seller;
10
11
class DomainsCest
12
{
13
    /**
14
     * @var IndexPage
15
     */
16
    private $index;
17
18
    public function _before(Seller $I)
19
    {
20
        $this->index = new IndexPage($I);
21
    }
22
23
    public function ensureIndexPageWorks(Seller $I)
24
    {
25
        $I->login();
26
        $I->needPage(Url::to('@hdomain'));
27
        $I->see('Domains', 'h1');
28
        $I->see('Create domain', 'a');
29
        $this->ensureICanSeeAdvancedSearchBox();
30
        $this->ensureICanSeeLegendBox();
31
        $this->ensureICanSeeBulkSearchBox();
32
    }
33
34
    private function ensureICanSeeAdvancedSearchBox()
35
    {
36
        $this->index->containsFilters([
37
            new Input('Domain name'),
38
            new Input('Domain list (comma-separated)'),
39
            new Input('IP'),
40
            new Select2('Status'),
41
            new Select2('Show aliases only'),
42
            new Select2('Server'),
43
        ]);
44
    }
45
46
    private function ensureICanSeeLegendBox()
47
    {
48
        $this->index->containsLegend([
49
            'Domain',
50
            'DNS records',
51
            'Alias',
52
            'Name server',
53
            'Complex domain',
54
        ]);
55
    }
56
57
    private function ensureICanSeeBulkSearchBox()
58
    {
59
        $this->index->containsBulkButtons([
60
            'Delete',
61
        ]);
62
        $this->index->containsColumns([
63
            'Domain name',
64
            'Account',
65
            'Server',
66
            'Status',
67
            'IP',
68
            'Service',
69
        ]);
70
    }
71
}
72