Completed
Push — master ( c1d777...82fec5 )
by Dmitry
14:05 queued 10s
created

tests/acceptance/client/MailboxesCest.php (4 issues)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
3
namespace hipanel\modules\hosting\tests\acceptance\client;
4
5
use hipanel\helpers\Url;
6
use hipanel\tests\_support\Page\IndexPage;
7
use hipanel\tests\_support\Page\Widget\Input\Input;
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($I);
30
        $this->ensureICanSeeLegendBox();
31
        $this->ensureICanSeeBulkSearchBox();
32
    }
33
34
    private function ensureICanSeeAdvancedSearchBox(Client $I)
35
    {
36
        $this->index->containsFilters([
37
            Input::asAdvancedSearch($I, 'E-mail'),
0 ignored issues
show
The method asAdvancedSearch() does not seem to exist on object<hipanel\tests\_su...age\Widget\Input\Input>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
38
            Select2::asAdvancedSearch($I, 'Server'),
0 ignored issues
show
The method asAdvancedSearch() does not seem to exist on object<hipanel\tests\_su...e\Widget\Input\Select2>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
39
            Select2::asAdvancedSearch($I, 'Status'),
0 ignored issues
show
The method asAdvancedSearch() does not seem to exist on object<hipanel\tests\_su...e\Widget\Input\Select2>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
40
            Select2::asAdvancedSearch($I, 'Type'),
0 ignored issues
show
The method asAdvancedSearch() does not seem to exist on object<hipanel\tests\_su...e\Widget\Input\Select2>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
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