Completed
Pull Request — master (#23)
by
unknown
05:44
created

Admin::login()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 13
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 13
rs 9.4285
cc 2
eloc 7
nc 2
nop 0
1
<?php
2
3
namespace hipanel\tests\_support\Step\Acceptance;
4
5
use hipanel\tests\_support\Page\Login;
6
7
class Admin extends Client
8
{
9
    public function login()
10
    {
11
        if ($this->loadSessionSnapshot('login-admin')) {
12
            return $this;
13
        }
14
15
        $hiam = new Login($this);
16
        $hiam->login($this->username, $this->password);
17
18
        $this->saveSessionSnapshot('login-admin');
19
20
        return $this;
21
    }
22
23
    protected function initCredentials()
24
    {
25
        [$this->username, $this->password] = $this->getAdminCredentials();
26
    }
27
}
28