source: branches/version-2_13-dev/tests/class/helper/SC_Helper_TaxRule/SC_Helper_TaxRule_TestBase.php @ 23333

Revision 23333, 3.6 KB checked in by kimoto, 7 years ago (diff)

#2503 商品別税率設定の不具合を確認する為のテストを追加

Line 
1<?php
2$HOME = realpath(dirname(__FILE__)) . "/../../../..";
3require_once($HOME . "/tests/class/Common_TestCase.php");
4/*
5 * This file is part of EC-CUBE
6 *
7 * Copyright(c) 2000-2013 LOCKON CO.,LTD. All Rights Reserved.
8 *
9 * http://www.lockon.co.jp/
10 *
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; either version 2
14 * of the License, or (at your option) any later version.
15 *
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19 * GNU General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
24 */
25/**
26 * SC_Helper_Taxのテストの基底クラス.
27 *
28 * @author Nobuhiko Kimoto
29 * @version $Id$
30 */
31class SC_Helper_TaxRule_TestBase extends Common_TestCase
32{
33
34    protected function setUp()
35    {
36        parent::setUp();
37    }
38
39    protected function tearDown()
40    {
41        parent::tearDown();
42    }
43
44    /**
45     * DBにテストデータを登録する
46     */
47    protected function setUpTax()
48    {
49        $taxs = array(
50            array(
51                'tax_rule_id' => 1000,
52                'apply_date' => '2014-01-01 00:00:00',
53                'tax_rate' => '5',
54                'product_id' => '0',
55                'product_class_id' => '0',
56                'del_flg' => '0',
57                'member_id' => 1,
58                'create_date' => 'CURRENT_TIMESTAMP',
59                'update_date' => 'CURRENT_TIMESTAMP',
60            ),
61            array(
62                'tax_rule_id' => 1001,
63                'apply_date' => '2000-01-01 00:00:00',
64                'tax_rate' => '6',
65                'product_id' => '0',
66                'product_class_id' => '0',
67                'del_flg' => '0',
68                'member_id' => 1,
69                'create_date' => 'CURRENT_TIMESTAMP',
70                'update_date' => 'CURRENT_TIMESTAMP',
71            ),
72            array(
73                'tax_rule_id' => 1002,
74                'apply_date' => '2099-02-01 00:00:00',
75                'tax_rate' => '7',
76                'product_id' => '0',
77                'product_class_id' => '0',
78                'del_flg' => '0',
79                'member_id' => 1,
80                'create_date' => 'CURRENT_TIMESTAMP',
81                'update_date' => 'CURRENT_TIMESTAMP',
82            ),
83            array(
84                'tax_rule_id' => 1003,
85                'apply_date' => '2014-02-02 00:00:00',
86                'tax_rate' => '8',
87                'product_id' => '1000',
88                'product_class_id' => '0',
89                'del_flg' => '0',
90                'member_id' => 1,
91                'create_date' => 'CURRENT_TIMESTAMP',
92                'update_date' => 'CURRENT_TIMESTAMP',
93            ),
94            array(
95                'tax_rule_id' => 1004,
96                'apply_date' => '2014-02-03 00:00:00',
97                'tax_rate' => '9',
98                'product_id' => '1000',
99                'product_class_id' => '2000',
100                'del_flg' => '0',
101                'member_id' => 1,
102                'create_date' => 'CURRENT_TIMESTAMP',
103                'update_date' => 'CURRENT_TIMESTAMP',
104            ),
105        );
106
107        $this->objQuery->delete('dtb_tax_rule');
108        foreach ($taxs as $key => $item) {
109            $this->objQuery->insert('dtb_tax_rule', $item);
110        }
111    }
112}
Note: See TracBrowser for help on using the repository browser.