Code Duplication    Length = 51-51 lines in 2 locations

tests/acceptance/admin/BackupsCest.php 1 location

@@ 18-68 (lines=51) @@
15
use hipanel\tests\_support\Page\Widget\Input\Select2;
16
use hipanel\tests\_support\Step\Acceptance\Admin;
17
18
class BackupsCest
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('@backuping'));
34
        $I->see('Backups', '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, 'State'),
43
            Select2::asAdvancedSearch($I, 'Account'),
44
            Select2::asAdvancedSearch($I, 'Server'),
45
            Select2::asAdvancedSearch($I, 'Client'),
46
        ]);
47
    }
48
49
    private function ensureICanSeeBulkSearchBox()
50
    {
51
        $this->index->containsBulkButtons([
52
            'Enable',
53
            'Disable',
54
            'Delete',
55
        ]);
56
        $this->index->containsColumns([
57
            'Name',
58
            'Client',
59
            'Account',
60
            'Server',
61
            'Count',
62
            'Periodicity',
63
            'State',
64
            'Last backup',
65
            'Disk usage',
66
        ]);
67
    }
68
}
69

tests/acceptance/seller/BackupsCest.php 1 location

@@ 18-68 (lines=51) @@
15
use hipanel\tests\_support\Page\Widget\Input\Select2;
16
use hipanel\tests\_support\Step\Acceptance\Seller;
17
18
class BackupsCest
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('@backuping'));
34
        $I->see('Backups', '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, 'State'),
43
            Select2::asAdvancedSearch($I, 'Account'),
44
            Select2::asAdvancedSearch($I, 'Server'),
45
            Select2::asAdvancedSearch($I, 'Client'),
46
        ]);
47
    }
48
49
    private function ensureICanSeeBulkSearchBox()
50
    {
51
        $this->index->containsBulkButtons([
52
            'Enable',
53
            'Disable',
54
            'Delete',
55
        ]);
56
        $this->index->containsColumns([
57
            'Name',
58
            'Client',
59
            'Account',
60
            'Server',
61
            'Count',
62
            'Periodicity',
63
            'State',
64
            'Last backup',
65
            'Disk usage',
66
        ]);
67
    }
68
}
69