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

Revision 22141, 4.4 KB checked in by shift_hiroko.tamagawa, 10 years ago (diff)

#1978 SC_Helper_Purchaseの単体テスト一部を追加

  • 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' => '1002',
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       ),
78       array(
79         'product_id' => '1001',
80         'product_class_id' => '1001',
81         'product_type_id' => '1001',
82         'product_code' => 'pc1001',
83         'product_name' => '製品名1001',
84         'classcategory_name1' => 'cat10011',
85         'classcategory_name2' => 'cat10012',
86         'price' => '4000',
87         'quantity' => '15',
88         'point_rate' => '6',
89         'status' => '3',
90         'payment_date' => '2032-12-31 01:20:30',
91         'enable' => '1',
92         'effective' => '1'
93       )
94    );
95    $this->actual = SC_Helper_Purchase::getOrderDetail($order_id);
96
97    $this->verify();
98  }
99
100  public function testGetOrderDetail_ステータス取得フラグがOFFのの場合_ステータス以外の情報が取得できる() {
101    $order_id = '1001';
102
103    $this->expected = array(
104       array(
105         'product_id' => '1002',
106         'product_class_id' => '1002',
107         'product_type_id' => '1002',
108         'product_code' => 'pc1002',
109         'product_name' => '製品名1002',
110         'classcategory_name1' => 'cat10021',
111         'classcategory_name2' => 'cat10022',
112         'price' => '3000',
113         'quantity' => '10',
114         'point_rate' => '5',
115         // 'status' => '3',
116         // 'payment_date' => '2032-12-31 01:20:30',
117         'enable' => '0',
118         'effective' => '1'
119       ),
120       array(
121         'product_id' => '1001',
122         'product_class_id' => '1001',
123         'product_type_id' => '1001',
124         'product_code' => 'pc1001',
125         'product_name' => '製品名1001',
126         'classcategory_name1' => 'cat10011',
127         'classcategory_name2' => 'cat10012',
128         'price' => '4000',
129         'quantity' => '15',
130         'point_rate' => '6',
131         // 'status' => '3',
132         // 'payment_date' => '2032-12-31 01:20:30',
133         'enable' => '1',
134         'effective' => '1'
135       )
136    );
137    $this->actual = SC_Helper_Purchase::getOrderDetail($order_id, false);
138
139    $this->verify();
140  }
141
142  //////////////////////////////////////////
143
144}
145
Note: See TracBrowser for help on using the repository browser.