Code Duplication    Length = 58-58 lines in 3 locations

tests/acceptance/admin/MailboxesCest.php 1 location

@@ 11-68 (lines=58) @@
8
use hipanel\tests\_support\Page\Widget\Input\Select2;
9
use hipanel\tests\_support\Step\Acceptance\Admin;
10
11
class MailboxesCest
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('@mail'));
27
        $I->see('Mailboxes', 'h1');
28
        $I->seeLink('Create mailbox', Url::to('create'));
29
        $this->ensureICanSeeAdvancedSearchBox();
30
        $this->ensureICanSeeLegendBox();
31
        $this->ensureICanSeeBulkSearchBox();
32
    }
33
34
    private function ensureICanSeeAdvancedSearchBox()
35
    {
36
        $this->index->containsFilters([
37
            new Input('E-mail'),
38
            new Select2('Server'),
39
            new Select2('Status'),
40
            new Select2('Type'),
41
        ]);
42
    }
43
44
    private function ensureICanSeeLegendBox()
45
    {
46
        $this->index->containsLegend([
47
            'Mail box',
48
            'Mail alias',
49
            'Mail box with aliases',
50
        ]);
51
    }
52
53
    private function ensureICanSeeBulkSearchBox()
54
    {
55
        $this->index->containsBulkButtons([
56
            'Enable',
57
            'Disable',
58
            'Delete',
59
        ]);
60
        $this->index->containsColumns( [
61
            'E-mail',
62
            'Type',
63
            'Forwarding',
64
            'Server',
65
            'Status',
66
        ]);
67
    }
68
}
69

tests/acceptance/client/MailboxesCest.php 1 location

@@ 11-68 (lines=58) @@
8
use hipanel\tests\_support\Page\Widget\Input\Select2;
9
use hipanel\tests\_support\Step\Acceptance\Client;
10
11
class MailboxesCest
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('@mail'));
27
        $I->see('Mailboxes', 'h1');
28
        $I->seeLink('Create mailbox', Url::to('create'));
29
        $this->ensureICanSeeAdvancedSearchBox();
30
        $this->ensureICanSeeLegendBox();
31
        $this->ensureICanSeeBulkSearchBox();
32
    }
33
34
    private function ensureICanSeeAdvancedSearchBox()
35
    {
36
        $this->index->containsFilters([
37
            new Input('E-mail'),
38
            new Select2('Server'),
39
            new Select2('Status'),
40
            new Select2('Type'),
41
        ]);
42
    }
43
44
    private function ensureICanSeeLegendBox()
45
    {
46
        $this->index->containsLegend([
47
            'Mail box',
48
            'Mail alias',
49
            'Mail box with aliases',
50
        ]);
51
    }
52
53
    private function ensureICanSeeBulkSearchBox()
54
    {
55
        $this->index->containsBulkButtons([
56
            'Enable',
57
            'Disable',
58
            'Delete',
59
        ]);
60
        $this->index->containsColumns( [
61
            'E-mail',
62
            'Type',
63
            'Forwarding',
64
            'Server',
65
            'Status',
66
        ]);
67
    }
68
}
69

tests/acceptance/seller/MailboxesCest.php 1 location

@@ 11-68 (lines=58) @@
8
use hipanel\tests\_support\Page\Widget\Input\Select2;
9
use hipanel\tests\_support\Step\Acceptance\Seller;
10
11
class MailboxesCest
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('@mail'));
27
        $I->see('Mailboxes', 'h1');
28
        $I->seeLink('Create mailbox', Url::to('create'));
29
        $this->ensureICanSeeAdvancedSearchBox();
30
        $this->ensureICanSeeLegendBox();
31
        $this->ensureICanSeeBulkSearchBox();
32
    }
33
34
    private function ensureICanSeeAdvancedSearchBox()
35
    {
36
        $this->index->containsFilters([
37
            new Input('E-mail'),
38
            new Select2('Server'),
39
            new Select2('Status'),
40
            new Select2('Type'),
41
        ]);
42
    }
43
44
    private function ensureICanSeeLegendBox()
45
    {
46
        $this->index->containsLegend([
47
            'Mail box',
48
            'Mail alias',
49
            'Mail box with aliases',
50
        ]);
51
    }
52
53
    private function ensureICanSeeBulkSearchBox()
54
    {
55
        $this->index->containsBulkButtons([
56
            'Enable',
57
            'Disable',
58
            'Delete',
59
        ]);
60
        $this->index->containsColumns( [
61
            'E-mail',
62
            'Type',
63
            'Forwarding',
64
            'Server',
65
            'Status',
66
        ]);
67
    }
68
}
69