Code Duplication    Length = 46-46 lines in 2 locations

tests/acceptance/admin/ServicesCest.php 1 location

@@ 11-56 (lines=46) @@
8
use hipanel\tests\_support\Page\Widget\Input\Select2;
9
use hipanel\tests\_support\Step\Acceptance\Admin;
10
11
class ServicesCest
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('@service'));
27
        $I->see('Services', 'h1');
28
        $this->ensureICanSeeAdvancedSearchBox();
29
        $this->ensureICanSeeBulkSearchBox();
30
    }
31
32
    private function ensureICanSeeAdvancedSearchBox()
33
    {
34
        $this->index->containsFilters([
35
            new Input('Name'),
36
            new Select2('Server'),
37
            new Select2('Client'),
38
            new Select2('Reseller'),
39
            new Select2('Soft'),
40
            new Select2('Status'),
41
        ]);
42
    }
43
44
    private function ensureICanSeeBulkSearchBox()
45
    {
46
        $this->index->containsColumns([
47
            'Reseller',
48
            'Client',
49
            'Server',
50
            'Object',
51
            'IP',
52
            'Soft',
53
            'Status',
54
        ]);
55
    }
56
}
57

tests/acceptance/seller/ServicesCest.php 1 location

@@ 11-56 (lines=46) @@
8
use hipanel\tests\_support\Page\Widget\Input\Select2;
9
use hipanel\tests\_support\Step\Acceptance\Seller;
10
11
class ServicesCest
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('@service'));
27
        $I->see('Services', 'h1');
28
        $this->ensureICanSeeAdvancedSearchBox();
29
        $this->ensureICanSeeBulkSearchBox();
30
    }
31
32
    private function ensureICanSeeAdvancedSearchBox()
33
    {
34
        $this->index->containsFilters([
35
            new Input('Name'),
36
            new Select2('Server'),
37
            new Select2('Client'),
38
            new Select2('Reseller'),
39
            new Select2('Soft'),
40
            new Select2('Status'),
41
        ]);
42
    }
43
44
    private function ensureICanSeeBulkSearchBox()
45
    {
46
        $this->index->containsColumns([
47
            'Reseller',
48
            'Client',
49
            'Server',
50
            'Object',
51
            'IP',
52
            'Soft',
53
            'Status',
54
        ]);
55
    }
56
}
57