1 | <?php |
---|
2 | |
---|
3 | $HOME = realpath(dirname(__FILE__)) . "/../../../.."; |
---|
4 | require_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-2013 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 | */ |
---|
34 | class SC_Helper_Purchase_getOrderDetailTest extends SC_Helper_Purchase_TestBase |
---|
35 | { |
---|
36 | |
---|
37 | |
---|
38 | protected function setUp() |
---|
39 | { |
---|
40 | parent::setUp(); |
---|
41 | $this->setUpOrder(); |
---|
42 | $this->setUpOrderDetail(); |
---|
43 | $this->setUpProductClass(); |
---|
44 | } |
---|
45 | |
---|
46 | protected function tearDown() |
---|
47 | { |
---|
48 | parent::tearDown(); |
---|
49 | } |
---|
50 | |
---|
51 | ///////////////////////////////////////// |
---|
52 | public function testGetOrderDetail_存在しない受注IDを指定した場合_結果が空になる() |
---|
53 | { |
---|
54 | $order_id = '9999'; |
---|
55 | |
---|
56 | $this->expected = array(); |
---|
57 | $this->actual = SC_Helper_Purchase::getOrderDetail($order_id); |
---|
58 | |
---|
59 | $this->verify(); |
---|
60 | } |
---|
61 | |
---|
62 | public function testGetOrderDetail_存在する受注IDを指定した場合_対応する受注詳細情報が取得できる() |
---|
63 | { |
---|
64 | $order_id = '1001'; |
---|
65 | |
---|
66 | $this->expected = array( |
---|
67 | array( |
---|
68 | 'product_id' => '1002', |
---|
69 | 'product_class_id' => '1002', |
---|
70 | 'product_type_id' => '2', |
---|
71 | 'product_code' => 'pc1002', |
---|
72 | 'product_name' => '製品名1002', |
---|
73 | 'classcategory_name1' => 'cat10021', |
---|
74 | 'classcategory_name2' => 'cat10022', |
---|
75 | 'price' => '3000', |
---|
76 | 'quantity' => '10', |
---|
77 | 'point_rate' => '5', |
---|
78 | 'status' => '3', |
---|
79 | 'payment_date' => '2032-12-31 01:20:30', |
---|
80 | 'enable' => '0', |
---|
81 | 'effective' => '1', |
---|
82 | 'tax_rate' => '5', |
---|
83 | 'tax_rule' => '0' |
---|
84 | ), |
---|
85 | array( |
---|
86 | 'product_id' => '1001', |
---|
87 | 'product_class_id' => '1001', |
---|
88 | 'product_type_id' => '1', |
---|
89 | 'product_code' => 'pc1001', |
---|
90 | 'product_name' => '製品名1001', |
---|
91 | 'classcategory_name1' => 'cat10011', |
---|
92 | 'classcategory_name2' => 'cat10012', |
---|
93 | 'price' => '4000', |
---|
94 | 'quantity' => '15', |
---|
95 | 'point_rate' => '6', |
---|
96 | 'status' => '3', |
---|
97 | 'payment_date' => '2032-12-31 01:20:30', |
---|
98 | 'enable' => '1', |
---|
99 | 'effective' => '1', |
---|
100 | 'tax_rate' => '3', |
---|
101 | 'tax_rule' => '1' |
---|
102 | ) |
---|
103 | ); |
---|
104 | $this->actual = SC_Helper_Purchase::getOrderDetail($order_id); |
---|
105 | |
---|
106 | $this->verify(); |
---|
107 | } |
---|
108 | |
---|
109 | public function testGetOrderDetail_ステータス取得フラグがOFFのの場合_ステータス以外の情報が取得できる() |
---|
110 | { |
---|
111 | $order_id = '1001'; |
---|
112 | |
---|
113 | $this->expected = array( |
---|
114 | array( |
---|
115 | 'product_id' => '1002', |
---|
116 | 'product_class_id' => '1002', |
---|
117 | 'product_type_id' => '2', |
---|
118 | 'product_code' => 'pc1002', |
---|
119 | 'product_name' => '製品名1002', |
---|
120 | 'classcategory_name1' => 'cat10021', |
---|
121 | 'classcategory_name2' => 'cat10022', |
---|
122 | 'price' => '3000', |
---|
123 | 'quantity' => '10', |
---|
124 | 'point_rate' => '5', |
---|
125 | // 'status' => '3', |
---|
126 | // 'payment_date' => '2032-12-31 01:20:30', |
---|
127 | 'enable' => '0', |
---|
128 | 'effective' => '1', |
---|
129 | 'tax_rate' => '5', |
---|
130 | 'tax_rule' => '0' |
---|
131 | ), |
---|
132 | array( |
---|
133 | 'product_id' => '1001', |
---|
134 | 'product_class_id' => '1001', |
---|
135 | 'product_type_id' => '1', |
---|
136 | 'product_code' => 'pc1001', |
---|
137 | 'product_name' => '製品名1001', |
---|
138 | 'classcategory_name1' => 'cat10011', |
---|
139 | 'classcategory_name2' => 'cat10012', |
---|
140 | 'price' => '4000', |
---|
141 | 'quantity' => '15', |
---|
142 | 'point_rate' => '6', |
---|
143 | // 'status' => '3', |
---|
144 | // 'payment_date' => '2032-12-31 01:20:30', |
---|
145 | 'enable' => '1', |
---|
146 | 'effective' => '1', |
---|
147 | 'tax_rate' => '3', |
---|
148 | 'tax_rule' => '1' |
---|
149 | ) |
---|
150 | ); |
---|
151 | $this->actual = SC_Helper_Purchase::getOrderDetail($order_id, false); |
---|
152 | |
---|
153 | $this->verify(); |
---|
154 | } |
---|
155 | |
---|
156 | ////////////////////////////////////////// |
---|
157 | |
---|
158 | } |
---|
159 | |
---|