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::sfUpdateOrderNameCol()のテストクラス. |
---|
29 | * |
---|
30 | * |
---|
31 | * @author Hiroko Tamagawa |
---|
32 | * @version $Id$ |
---|
33 | */ |
---|
34 | class SC_Helper_Purchase_sfUpdateOrderNameColTest extends SC_Helper_Purchase_TestBase { |
---|
35 | var $helper; |
---|
36 | |
---|
37 | protected function setUp() { |
---|
38 | parent::setUp(); |
---|
39 | $this->setUpOrder(); |
---|
40 | $this->setUpOrderTemp(); |
---|
41 | $this->setUpPayment(); |
---|
42 | $this->setUpDeliv(); |
---|
43 | $this->setUpDelivTime(); |
---|
44 | $this->setUpShippingOnDb(); |
---|
45 | |
---|
46 | $this->helper = new SC_Helper_Purchase(); |
---|
47 | } |
---|
48 | |
---|
49 | protected function tearDown() { |
---|
50 | parent::tearDown(); |
---|
51 | } |
---|
52 | |
---|
53 | ///////////////////////////////////////// |
---|
54 | public function testSfUpdateOrderNameCol_TEMPフラグがOFFの場合_受注テーブルと発送テーブルが更新される() { |
---|
55 | $order_id = '1002'; |
---|
56 | |
---|
57 | $this->helper->sfUpdateOrderNameCol($order_id); |
---|
58 | |
---|
59 | $this->expected['shipping'] = array(array('shipping_time' => '午前')); |
---|
60 | $this->expected['order'] = array(array('payment_method' => '支払方法1002')); |
---|
61 | $this->expected['order_temp'] = array(array('payment_method' => '支払方法1001')); // 変更されていない |
---|
62 | |
---|
63 | $this->actual['shipping'] = $this->objQuery->select( |
---|
64 | 'shipping_time', 'dtb_shipping', 'order_id = ?', array($order_id) |
---|
65 | ); |
---|
66 | $this->actual['order'] = $this->objQuery->select( |
---|
67 | 'payment_method', 'dtb_order', 'order_id = ?', array($order_id) |
---|
68 | ); |
---|
69 | $this->actual['order_temp'] = $this->objQuery->select( |
---|
70 | 'payment_method', 'dtb_order_temp', 'order_temp_id = ?', array($order_id) |
---|
71 | ); |
---|
72 | $this->verify(); |
---|
73 | } |
---|
74 | |
---|
75 | public function testSfUpdateOrderNameCol_TEMPフラグがONの場合_一時テーブルが更新される() { |
---|
76 | $order_id = '1002'; |
---|
77 | |
---|
78 | $this->helper->sfUpdateOrderNameCol($order_id, true); |
---|
79 | |
---|
80 | $this->expected['shipping'] = array(array('shipping_time' => '午後')); // 変更されていない |
---|
81 | $this->expected['order'] = array(array('payment_method' => '支払方法1001')); // 変更されていない |
---|
82 | $this->expected['order_temp'] = array(array('payment_method' => '支払方法1002')); |
---|
83 | |
---|
84 | $this->actual['shipping'] = $this->objQuery->select( |
---|
85 | 'shipping_time', 'dtb_shipping', 'order_id = ?', array($order_id) |
---|
86 | ); |
---|
87 | $this->actual['order'] = $this->objQuery->select( |
---|
88 | 'payment_method', 'dtb_order', 'order_id = ?', array($order_id) |
---|
89 | ); |
---|
90 | $this->actual['order_temp'] = $this->objQuery->select( |
---|
91 | 'payment_method', 'dtb_order_temp', 'order_temp_id = ?', array($order_id) |
---|
92 | ); |
---|
93 | $this->verify(); |
---|
94 | } |
---|
95 | |
---|
96 | ////////////////////////////////////////// |
---|
97 | |
---|
98 | } |
---|
99 | |
---|