source: branches/version-2_12-dev/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_getOrderDetailTest.php @ 22202

Revision 22202, 4.6 KB checked in by shift_hiroko.tamagawa, 11 years ago (diff)

#1977 #1978 単体テストのファイルにコピーライトを追記、定数が邪魔をしてテストできない箇所をいったんコメントアウト

  • Property svn:keywords set to Id Rev Date
Line 
1<?php
2
3$HOME = realpath(dirname(__FILE__)) . "/../../../..";
4require_once($HOME . "/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_TestBase.php");
5/*
6 * This file is part of EC-CUBE
7 *
8 * Copyright(c) 2000-2012 LOCKON CO.,LTD. All Rights Reserved.
9 *
10 * http://www.lockon.co.jp/
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20 * GNU General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
25 */
26
27/**
28 * SC_Helper_Purchase::getOrderDetail()のテストクラス.
29 *
30 *
31 * @author Hiroko Tamagawa
32 * @version $Id$
33 */
34class SC_Helper_Purchase_getOrderDetailTest extends SC_Helper_Purchase_TestBase {
35
36
37  protected function setUp() {
38    parent::setUp();
39    $this->setUpOrder();
40    $this->setUpOrderDetail();
41    $this->setUpProductClass();
42  }
43
44  protected function tearDown() {
45    parent::tearDown();
46  }
47
48  /////////////////////////////////////////
49  public function testGetOrderDetail_存在しない受注IDを指定した場合_結果が空になる() {
50    $order_id = '9999';
51
52    $this->expected = array();
53    $this->actual = SC_Helper_Purchase::getOrderDetail($order_id);
54
55    $this->verify();
56  }
57
58  public function testGetOrderDetail_存在する受注IDを指定した場合_対応する受注詳細情報が取得できる() {
59    $order_id = '1001';
60
61    $this->expected = array(
62       array(
63         'product_id' => '1002',
64         'product_class_id' => '1002',
65         'product_type_id' => '2',
66         'product_code' => 'pc1002',
67         'product_name' => '製品名1002',
68         'classcategory_name1' => 'cat10021',
69         'classcategory_name2' => 'cat10022',
70         'price' => '3000',
71         'quantity' => '10',
72         'point_rate' => '5',
73         'status' => '3',
74         'payment_date' => '2032-12-31 01:20:30',
75         'enable' => '0',
76         'effective' => '1',
77         'tax_rate' => '5',
78         'tax_rule' => '0'
79       ),
80       array(
81         'product_id' => '1001',
82         'product_class_id' => '1001',
83         'product_type_id' => '1',
84         'product_code' => 'pc1001',
85         'product_name' => '製品名1001',
86         'classcategory_name1' => 'cat10011',
87         'classcategory_name2' => 'cat10012',
88         'price' => '4000',
89         'quantity' => '15',
90         'point_rate' => '6',
91         'status' => '3',
92         'payment_date' => '2032-12-31 01:20:30',
93         'enable' => '1',
94         'effective' => '1',
95         'tax_rate' => '3',
96         'tax_rule' => '1'
97       )
98    );
99    $this->actual = SC_Helper_Purchase::getOrderDetail($order_id);
100
101    $this->verify();
102  }
103
104  public function testGetOrderDetail_ステータス取得フラグがOFFのの場合_ステータス以外の情報が取得できる() {
105    $order_id = '1001';
106
107    $this->expected = array(
108       array(
109         'product_id' => '1002',
110         'product_class_id' => '1002',
111         'product_type_id' => '2',
112         'product_code' => 'pc1002',
113         'product_name' => '製品名1002',
114         'classcategory_name1' => 'cat10021',
115         'classcategory_name2' => 'cat10022',
116         'price' => '3000',
117         'quantity' => '10',
118         'point_rate' => '5',
119         // 'status' => '3',
120         // 'payment_date' => '2032-12-31 01:20:30',
121         'enable' => '0',
122         'effective' => '1',
123         'tax_rate' => '5',
124         'tax_rule' => '0'
125       ),
126       array(
127         'product_id' => '1001',
128         'product_class_id' => '1001',
129         'product_type_id' => '1',
130         'product_code' => 'pc1001',
131         'product_name' => '製品名1001',
132         'classcategory_name1' => 'cat10011',
133         'classcategory_name2' => 'cat10012',
134         'price' => '4000',
135         'quantity' => '15',
136         'point_rate' => '6',
137         // 'status' => '3',
138         // 'payment_date' => '2032-12-31 01:20:30',
139         'enable' => '1',
140         'effective' => '1',
141         'tax_rate' => '3',
142         'tax_rule' => '1'
143       )
144    );
145    $this->actual = SC_Helper_Purchase::getOrderDetail($order_id, false);
146
147    $this->verify();
148  }
149
150  //////////////////////////////////////////
151
152}
153
Note: See TracBrowser for help on using the repository browser.