Failed Conditions
Pull Request — experimental/sf (#3236)
by Kentaro
142:37 queued 134:37
created

ShoppingConfirmPage   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 28
Duplicated Lines 50 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

1
<?php
2
/*
3
 * This file is part of EC-CUBE
4
 *
5
 * Copyright(c) 2000-2017 LOCKON CO.,LTD. All Rights Reserved.
6
 *
7
 * http://www.lockon.co.jp/
8
 *
9
 * This program is free software; you can redistribute it and/or
10
 * modify it under the terms of the GNU General Public License
11
 * as published by the Free Software Foundation; either version 2
12
 * of the License, or (at your option) any later version.
13
 *
14
 * This program is distributed in the hope that it will be useful,
15
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
 * GNU General Public License for more details.
18
 *
19
 * You should have received a copy of the GNU General Public License
20
 * along with this program; if not, write to the Free Software
21
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
22
 */
23
24
namespace Page\Front;
25
26
27
class ShoppingConfirmPage extends AbstractFrontPage
28
{
29
    public function __construct(\AcceptanceTester $I)
30
    {
31
        parent::__construct($I);
32
    }
33
34
    public static function at($I)
35
    {
36
        $page = new self($I);
37
        $page->tester->see('ご注文内容のご確認', 'div.ec-pageHeader h1');
38
        $page->tester->see('お客様情報', '#shopping-form div.ec-orderAccount div.ec-rectHeading h2');
39
        $page->tester->see('配送情報', '#shopping-form div.ec-orderDelivery div.ec-rectHeading h2');
40
        $page->tester->see('お支払方法', '#shopping-form div.ec-orderPayment div.ec-rectHeading h2');
41
        $page->tester->see('お問い合わせ', '#shopping-form div.ec-orderConfirm div.ec-rectHeading h2');
42
        $page->tester->see('小計', '#shopping-form div.ec-orderRole__summary div.ec-totalBox');
43
        $page->tester->see('手数料', '#shopping-form div.ec-orderRole__summary div.ec-totalBox');
44
        $page->tester->see('送料', '#shopping-form div.ec-orderRole__summary div.ec-totalBox');
45
        $page->tester->see('合計', '#shopping-form div.ec-orderRole__summary div.ec-totalBox');
46
        return $page;
47
    }
48
49
    public function 注文する()
50
    {
51
        $this->tester->click('#shopping-form div.ec-orderRole__summary div.ec-totalBox button');
52
        return $this;
53
    }
54
}