Completed
Pull Request — master (#33)
by Dmitry
12:31
created

PaymentsCest::ensureBillPageWorks()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
namespace hipanel\modules\finance\tests\acceptance\manager;
4
5
6
use hipanel\helpers\Url;
7
use hipanel\modules\finance\tests\_support\Page\bill\Create;
8
use hipanel\tests\_support\Step\Acceptance\Manager;
9
10
class PaymentsCest
11
{
12
    public function ensureBillPageWorks(Manager $I): void
13
    {
14
        $I->login();
15
        $I->needPage(Url::to('@bill'));
16
    }
17
18
    public function ensureICantCreateBillWithoutRequiredData(Manager $I): void
19
    {
20
        (new Create($I))->createBillWithoutData();
21
    }
22
23
    public function ensureICanCreateSimpledBill(Manager $I): void
24
    {
25
        (new Create($I))->createBill($this->getBillData());
26
    }
27
28
    public function ensureICantCreateDetailedBillWithoutDetailedData(Manager $I): void
29
    {
30
        (new Create($I))->createDetailedBillWithoutDetailedData($this->getBillData());
31
    }
32
33
    public function ensureICanCreateDetailedBill(Manager $I): void
34
    {
35
        (new Create($I))->createDetailedBill($this->getBillData());
36
    }
37
38
    protected function getBillData(): array
39
    {
40
        return [
41
            'login'     => '[email protected]',
42
            'type'      => 'monthly,monthly',
43
            'currency'  => '$',
44
            'sum'       =>  10,
45
            'quantity'  =>  1
46
        ];
47
    }
48
}
49