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

Revision 23344, 3.3 KB checked in by kimoto, 10 years ago (diff)

#2503 add @preserveGlobalState disabled

Line 
1<?php
2
3$HOME = realpath(dirname(__FILE__)) . "/../../../..";
4// 商品別税率機能無効
5define('OPTION_PRODUCT_TAX_RULE', 0);
6require_once($HOME . "/tests/class/helper/SC_Helper_TaxRule/SC_Helper_TaxRule_TestBase.php");
7
8class SC_Helper_TaxRule_getTaxRuleTest extends SC_Helper_TaxRule_TestBase
9{
10
11    protected function setUp()
12    {
13        parent::setUp();
14        $this->objTaxRule = new SC_Helper_TaxRule_Ex();
15        $this->setUpTax();
16    }
17
18    protected function tearDown()
19    {
20        parent::tearDown();
21    }
22
23    /////////////////////////////////////////
24
25    /**
26     * @test
27     * @runInSeparateProcess
28     * @preserveGlobalState disabled
29     */
30    public function 定数が正しく設定されているかのテスト()
31    {
32        $this->expected = 0;
33        $this->actual = constant('OPTION_PRODUCT_TAX_RULE');
34        $this->verify();
35    }
36
37    /**
38     * @test
39     * @runInSeparateProcess
40     * @preserveGlobalState disabled
41     */
42    public function 引数がからの場合税率設定で設定かつ適用日時内の最新の値が返される()
43    {
44        $this->expected = array(
45            'apply_date' => '2014-01-01 00:00:00',
46            'tax_rate' => '5',
47            'product_id' => '0',
48            'product_class_id' => '0',
49            'del_flg' => '0'
50        );
51
52        $return = $this->objTaxRule->getTaxRule();
53        $this->actual = array(
54            'apply_date' => $return['apply_date'],
55            'tax_rate' => $return['tax_rate'],
56            'product_id' => $return['product_id'],
57            'product_class_id' => $return['product_class_id'],
58            'del_flg' => $return['del_flg']
59        );
60
61        $this->verify();
62    }
63
64    /**
65     * @test
66     * @runInSeparateProcess
67     * @preserveGlobalState disabled
68     */
69    public function 商品idを指定した場合税率設定で設定かつ適用日時内の最新の値が返される()
70    {
71        $this->expected = array(
72            'apply_date' => '2014-01-01 00:00:00',
73            'tax_rate' => '5',
74            'product_id' => '0',
75            'product_class_id' => '0',
76            'del_flg' => '0'
77        );
78
79        $return = $this->objTaxRule->getTaxRule(1000);
80        $this->actual = array(
81            'apply_date' => $return['apply_date'],
82            'tax_rate' => $return['tax_rate'],
83            'product_id' => $return['product_id'],
84            'product_class_id' => $return['product_class_id'],
85            'del_flg' => $return['del_flg']
86        );
87
88        $this->verify();
89    }
90
91    /**
92     * @test
93     * @runInSeparateProcess
94     * @preserveGlobalState disabled
95     */
96    public function 商品規格idを指定した場合税率設定で設定かつ適用日時内の最新の値が返される()
97    {
98        $this->expected = array(
99            'apply_date' => '2014-01-01 00:00:00',
100            'tax_rate' => '5',
101            'product_id' => '0',
102            'product_class_id' => '0',
103            'del_flg' => '0'
104        );
105
106        $return = $this->objTaxRule->getTaxRule(1000, 2000);
107        $this->actual = array(
108            'apply_date' => $return['apply_date'],
109            'tax_rate' => $return['tax_rate'],
110            'product_id' => $return['product_id'],
111            'product_class_id' => $return['product_class_id'],
112            'del_flg' => $return['del_flg']
113        );
114
115        $this->verify();
116    }
117}
Note: See TracBrowser for help on using the repository browser.