Code Duplication    Length = 52-52 lines in 2 locations

tests/acceptance/admin/TicketCest.php 1 location

@@ 11-62 (lines=52) @@
8
use hipanel\tests\_support\Page\Widget\Input\Select2;
9
use hipanel\tests\_support\Step\Acceptance\Admin;
10
11
class TicketCest
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('@ticket'));
27
        $I->see('Tickets', 'h1');
28
        $I->seeLink('Create ticket', Url::to('@ticket/create'));
29
        $this->ensureICanSeeAdvancedSearchBox();
30
        $this->ensureICanSeeBulkSearchBox();
31
    }
32
33
    private function ensureICanSeeAdvancedSearchBox()
34
    {
35
        $this->index->containsFilters([
36
            new Input('Subject or message'),
37
            new Select2('Author'),
38
            new Select2('Recipient'),
39
            new Select2('Status'),
40
            new Select2('Assignee'),
41
            new Select2('Priority'),
42
            new Select2('Watchers'),
43
            new Input('Topics'),
44
        ]);
45
    }
46
47
    private function ensureICanSeeBulkSearchBox()
48
    {
49
        $this->index->containsBulkButtons([
50
            'Subscribe',
51
            'Unsubscribe',
52
            'Close',
53
        ]);
54
        $this->index->containsColumns([
55
            'Subject',
56
            'Author',
57
            'Assignee',
58
            'Recipient',
59
            'Answers',
60
        ]);
61
    }
62
}
63

tests/acceptance/seller/TicketCest.php 1 location

@@ 11-62 (lines=52) @@
8
use hipanel\tests\_support\Page\Widget\Input\Select2;
9
use hipanel\tests\_support\Step\Acceptance\Seller;
10
11
class TicketCest
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('@ticket'));
27
        $I->see('Tickets', 'h1');
28
        $I->seeLink('Create ticket', Url::to('@ticket/create'));
29
        $this->ensureICanSeeAdvancedSearchBox();
30
        $this->ensureICanSeeBulkSearchBox();
31
    }
32
33
    private function ensureICanSeeAdvancedSearchBox()
34
    {
35
        $this->index->containsFilters([
36
            new Input('Subject or message'),
37
            new Select2('Author'),
38
            new Select2('Recipient'),
39
            new Select2('Status'),
40
            new Select2('Assignee'),
41
            new Select2('Priority'),
42
            new Select2('Watchers'),
43
            new Input('Topics'),
44
        ]);
45
    }
46
47
    private function ensureICanSeeBulkSearchBox()
48
    {
49
        $this->index->containsBulkButtons([
50
            'Subscribe',
51
            'Unsubscribe',
52
            'Close',
53
        ]);
54
        $this->index->containsColumns([
55
            'Subject',
56
            'Author',
57
            'Assignee',
58
            'Recipient',
59
            'Answers',
60
        ]);
61
    }
62
}
63