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

Revision 22567, 3.5 KB checked in by shutta, 11 years ago (diff)

#2043 (typo修正・ソース整形・ソースコメントの改善 for 2.12.4)
Zend Framework PHP 標準コーディング規約のコーディングスタイルへ準拠。
classおよびfunctionの開始波括弧「{」のスタイルを修正。

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