Failed Conditions
Pull Request — experimental/sf (#3236)
by Kentaro
58:58 queued 51:26
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
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
}