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

tests/acceptance/admin/RequestsCest.php (5 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\admin;
4
5
use hipanel\helpers\Url;
6
use hipanel\tests\_support\Page\IndexPage;
7
use hipanel\tests\_support\Page\Widget\Input\Select2;
8
use hipanel\tests\_support\Step\Acceptance\Admin;
9
10 View Code Duplication
class RequestsCest
11
{
12
    /**
13
     * @var IndexPage
14
     */
15
    private $index;
16
17
    public function _before(Admin $I)
18
    {
19
        $this->index = new IndexPage($I);
20
    }
21
22
    public function ensureIndexPageWorks(Admin $I)
23
    {
24
        $I->login();
25
        $I->needPage(Url::to('@request'));
26
        $I->see('Requests', 'h1');
27
        $this->ensureICanSeeAdvancedSearchBox($I);
28
        $this->ensureICanSeeLegendBox();
29
        $this->ensureICanSeeBulkSearchBox();
30
    }
31
32
    private function ensureICanSeeAdvancedSearchBox(Admin $I)
33
    {
34
        $this->index->containsFilters([
35
            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...
36
            Select2::asAdvancedSearch($I, 'Account'),
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...
37
            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...
38
            Select2::asAdvancedSearch($I, 'Object'),
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, 'Client'),
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
        ]);
41
    }
42
43
    private function ensureICanSeeLegendBox()
44
    {
45
        $this->index->containsLegend([
46
            'Scheduled time:',
47
            'Already',
48
            'Deferred',
49
            'State:',
50
            'New',
51
            'In progress',
52
            'Done',
53
            'Error',
54
            'Buzzed',
55
        ]);
56
    }
57
58
    private function ensureICanSeeBulkSearchBox()
59
    {
60
        $this->index->containsBulkButtons([
61
            'Delete',
62
        ]);
63
        $this->index->containsColumns([
64
            'Action',
65
            'Server',
66
            'Account',
67
            'Object',
68
            'Time',
69
            'Status',
70
        ]);
71
    }
72
}
73