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

PaymentsCest   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 0
Metric Value
wmc 6
lcom 1
cbo 3
dl 0
loc 39
rs 10
c 0
b 0
f 0

6 Methods

Rating   Name   Duplication   Size   Complexity  
A ensureBillPageWorks() 0 5 1
A ensureICantCreateBillWithoutRequiredData() 0 4 1
A ensureICanCreateSimpledBill() 0 4 1
A ensureICantCreateDetailedBillWithoutDetailedData() 0 4 1
A ensureICanCreateDetailedBill() 0 4 1
A getBillData() 0 10 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