Failed Conditions
Push — modify-scrutinizeryml ( 361e25...08b4c1 )
by Kentaro
63:54 queued 57:30
created

AbstractAdminPage   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A goPage() 0 6 1
A atPage() 0 5 1
1
<?php
2
3
4
namespace Page\Admin;
5
6
use Codeception\Util\Fixtures;
7
8
abstract class AbstractAdminPage
9
{
10
    /** @var \AcceptanceTester $tester */
11
    protected $tester;
12
13
    /**
14
     * AbstractAdminPage constructor.
15
     */
16
    public function __construct(\AcceptanceTester $I)
17
    {
18
        $this->tester = $I;
19
    }
20
21
    /**
22
     * ページに移動。
23
     * @param $url string URL
24
     * @param $pageTitle string ページタイトル
25
     * @return $this
26
     */
27
    protected function goPage($url, $pageTitle)
28
    {
29
        $config = Fixtures::get('config');
30
        $this->tester->amOnPage('/'.$config['eccube_admin_route'].$url);
31
        return $this->atPage($pageTitle);
32
    }
33
34
    /**
35
     * ページに移動しているかどうか確認。
36
     * @param $pageTitle string ページタイトル
37
     * @return $this
38
     */
39
    protected function atPage($pageTitle)
40
    {
41
        $this->tester->see($pageTitle, '#main .page-header');
42
        return $this;
43
    }
44
}