Completed
Push — master ( c0773d...f38e64 )
by Andrii
12:11
created

CredentialsProvider::restartBrowser()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 0
1
<?php
2
namespace hipanel\tests\_support\Helper;
3
4
use Codeception\Lib\ModuleContainer;
5
use Codeception\Module\WebDriver;
6
7
/**
8
 * Class CredentialsProvider
9
 *
10
 * @author Dmytro Naumenko <[email protected]>
11
 */
12
class CredentialsProvider extends \Codeception\Module
13
{
14
    public function __construct(ModuleContainer $moduleContainer, $config = null)
15
    {
16
        parent::__construct($moduleContainer, $config);
17
18
        $this->requiredFields = [
19
            // Client
20
            'client.id', 'client.login', 'client.password',
21
            'seller.id', 'seller.login', 'seller.password',
22
            'admin.id', 'admin.login', 'admin.password',
23
        ];
24
    }
25
26
    public function getClientCredentials(): array
27
    {
28
        return [$this->config['client.id'], $this->config['client.login'], $this->config['client.password']];
29
    }
30
31
32
    public function getSellerCredentials(): array
33
    {
34
        return [$this->config['seller.id'], $this->config['seller.login'], $this->config['seller.password']];
35
    }
36
37
    public function getAdminCredentials(): array
38
    {
39
        return [$this->config['admin.id'], $this->config['admin.login'], $this->config['admin.password']];
40
    }
41
42
    public function restartBrowser()
43
    {
44
        /** @var WebDriver $wd */
45
        $wd = $this->getModule('WebDriver');
46
        $wd->_restart();
47
    }
48
}
49