Completed
Push — master ( c8110c...3d2236 )
by Dmitry
19:54 queued 16:15
created

Update   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A goToUpdatePage() 0 9 1
A seeBillWasUpdated() 0 7 1
1
<?php
2
3
namespace hipanel\modules\finance\tests\_support\Page\bill;
4
5
use hipanel\tests\_support\AcceptanceTester;
6
use hipanel\tests\_support\Page\Widget\Select2;
7
8
class Update extends Create
9
{
10
    protected $select2;
11
12
    public function __construct(AcceptanceTester $I)
13
    {
14
        parent::__construct($I);
15
16
        $this->select2 = new Select2($I);
17
    }
18
19
    /**
20
     * @param string $billId - id of bill that should be updated.
21
     */
22
    public function goToUpdatePage(string $billId): void
23
    {
24
        $I = $this->tester;
25
26
        $I->click("//tr[@data-key=$billId]/td/div/button");
27
        $I->click('//a[contains(text(),\'Update\')]');
28
29
        $I->seeInCurrentUrl('finance/bill/update?id');
30
    }
31
32
    /**
33
     *  Checks whether a bill was updated successfully.
34
     */
35
    public function seeBillWasUpdated(): void
36
    {
37
        $I = $this->tester;
38
39
        $I->closeNotification('Bill was updated successfully');
40
        $I->seeInCurrentUrl('/finance/bill?id');
41
    }
42
}
43