BillCest::_before()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
/**
3
 * Finance module for HiPanel
4
 *
5
 * @link      https://github.com/hiqdev/hipanel-module-finance
6
 * @package   hipanel-module-finance
7
 * @license   BSD-3-Clause
8
 * @copyright Copyright (c) 2015-2019, HiQDev (http://hiqdev.com/)
9
 */
10
11
namespace hipanel\modules\finance\tests\acceptance\client;
12
13
use hipanel\helpers\Url;
14
use hipanel\tests\_support\Page\IndexPage;
15
use hipanel\tests\_support\Page\Widget\Input\Input;
16
use hipanel\tests\_support\Page\Widget\Input\Select2;
17
use hipanel\tests\_support\Step\Acceptance\Client;
18
19
class BillCest
20
{
21
    /**
22
     * @var IndexPage
23
     */
24
    private $index;
25
26
    public function _before(Client $I)
27
    {
28
        $this->index = new IndexPage($I);
29
    }
30
31 View Code Duplication
    public function ensureIndexPageWorks(Client $I)
0 ignored issues
show
Duplication introduced by Pavlo
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
32
    {
33
        $I->login();
34
        $I->needPage(Url::to('@bill/index'));
35
        $I->see('Bills', 'h1');
36
        $I->seeLink('Recharge account', Url::to('@pay/deposit'));
37
        $this->ensureICanSeeAdvancedSearchBox($I);
38
        $this->ensureICanSeeBulkBillSearchBox();
39
    }
40
41
    private function ensureICanSeeAdvancedSearchBox(Client $I)
42
    {
43
        $this->index->containsFilters([
44
            Select2::asAdvancedSearch($I, 'Currency'),
45
            Select2::asAdvancedSearch($I, 'Type'),
46
            Input::asAdvancedSearch($I, 'Servers'),
47
            Input::asAdvancedSearch($I, 'Description'),
48
            Select2::asAdvancedSearch($I, 'Tariff'),
49
        ]);
50
    }
51
52
    private function ensureICanSeeBulkBillSearchBox()
53
    {
54
        $this->index->containsColumns([
55
            'Time',
56
            'Sum',
57
            'Balance',
58
            'Type',
59
            'Description',
60
        ]);
61
    }
62
}
63