Completed
Push — master ( 3f8dfc...6f8a88 )
by Dmitry
04:29
created

Client::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
nc 1
cc 1
eloc 3
nop 1
1
<?php
2
3
namespace hipanel\tests\_support\Step\Acceptance;
4
5
use Codeception\Scenario;
6
use hipanel\tests\_support\AcceptanceTester;
7
use hipanel\tests\_support\Page\Login;
8
9
class Client extends AcceptanceTester
10
{
11
    public function __construct(Scenario $scenario)
12
    {
13
        parent::__construct($scenario);
14
        $this->initCredentials();
15
    }
16
17
    protected $username;
18
    protected $password;
19
20
    public function login()
21
    {
22
        try {
23
            if ($this->loadSessionSnapshot('login-client')) {
24
                return $this;
25
            }
26
        } catch (\Facebook\WebDriver\Exception\UnknownServerException $exception) {
0 ignored issues
show
Bug introduced by
The class Facebook\WebDriver\Excep...\UnknownServerException does not exist. Did you forget a USE statement, or did you not list all dependencies?

Scrutinizer analyzes your composer.json/composer.lock file if available to determine the classes, and functions that are defined by your dependencies.

It seems like the listed class was neither found in your dependencies, nor was it found in the analyzed files in your repository. If you are using some other form of dependency management, you might want to disable this analysis.

Loading history...
27
            // User is already logged in, but trying to open a session on a page that is not loaded
28
            return $this;
29
        }
30
31
        $hiam = new Login($this);
32
        $hiam->login($this->username, $this->password);
33
34
        $this->saveSessionSnapshot('login-client');
35
36
        return $this;
37
    }
38
39
    protected function initCredentials()
40
    {
41
        [$this->username, $this->password] = $this->getClientCredentials();
42
    }
43
}
44