Index: /branches/version-2_13-dev/tests/class/helper/SC_Helper_TaxRule/SC_Helper_TaxRule_TestBase.php
===================================================================
--- /branches/version-2_13-dev/tests/class/helper/SC_Helper_TaxRule/SC_Helper_TaxRule_TestBase.php	(revision 23331)
+++ /branches/version-2_13-dev/tests/class/helper/SC_Helper_TaxRule/SC_Helper_TaxRule_TestBase.php	(revision 23331)
@@ -0,0 +1,97 @@
+<?php
+$HOME = realpath(dirname(__FILE__)) . "/../../../..";
+require_once($HOME . "/tests/class/Common_TestCase.php");
+/*
+ * This file is part of EC-CUBE
+ *
+ * Copyright(c) 2000-2013 LOCKON CO.,LTD. All Rights Reserved.
+ *
+ * http://www.lockon.co.jp/
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+/**
+ * SC_Helper_Taxのテストの基底クラス.
+ *
+ * @author Nobuhiko Kimoto
+ * @version $Id$
+ */
+class SC_Helper_TaxRule_TestBase extends Common_TestCase
+{
+
+    protected function setUp()
+    {
+        parent::setUp();
+    }
+
+    protected function tearDown()
+    {
+        parent::tearDown();
+    }
+
+    /**
+     * DBにテストデータを登録する
+     */
+    protected function setUpTax()
+    {
+        $taxs = array(
+            array(
+                'tax_rule_id' => 1000,
+                'apply_date' => '2014-01-01 00:00:00',
+                'tax_rate' => '5',
+                'product_id' => '0',
+                'product_class_id' => '0',
+                'del_flg' => '0'
+            ),
+            array(
+                'tax_rule_id' => 1001,
+                'apply_date' => '2000-01-01 00:00:00',
+                'tax_rate' => '6',
+                'product_id' => '0',
+                'product_class_id' => '0',
+                'del_flg' => '0'
+            ),
+            array(
+                'tax_rule_id' => 1002,
+                'apply_date' => '2099-02-01 00:00:00',
+                'tax_rate' => '7',
+                'product_id' => '0',
+                'product_class_id' => '0',
+                'del_flg' => '0'
+            ),
+            array(
+                'tax_rule_id' => 1003,
+                'apply_date' => '2014-02-02 00:00:00',
+                'tax_rate' => '8',
+                'product_id' => '1',
+                'product_class_id' => '0',
+                'del_flg' => '0'
+            ),
+            array(
+                'tax_rule_id' => 1004,
+                'apply_date' => '2014-02-03 00:00:00',
+                'tax_rate' => '9',
+                'product_id' => '1',
+                'product_class_id' => '1',
+                'del_flg' => '0'
+            ),
+        );
+
+        $this->objQuery->delete('dtb_tax_rule');
+        foreach ($taxs as $key => $item) {
+            $this->objQuery->insert('dtb_tax_rule', $item);
+        }
+    }
+}
Index: /branches/version-2_13-dev/tests/class/helper/SC_Helper_TaxRule/SC_Helper_TaxRule_getTaxRule_OptionProductTaxRuleTest.php
===================================================================
--- /branches/version-2_13-dev/tests/class/helper/SC_Helper_TaxRule/SC_Helper_TaxRule_getTaxRule_OptionProductTaxRuleTest.php	(revision 23331)
+++ /branches/version-2_13-dev/tests/class/helper/SC_Helper_TaxRule/SC_Helper_TaxRule_getTaxRule_OptionProductTaxRuleTest.php	(revision 23331)
@@ -0,0 +1,60 @@
+<?php
+
+$HOME = realpath(dirname(__FILE__)) . "/../../../..";
+// 商品別税率機能無効
+define('OPTION_PRODUCT_TAX_RULE', 1);
+require_once($HOME . "/tests/class/helper/SC_Helper_TaxRule/SC_Helper_TaxRule_TestBase.php");
+
+class SC_Helper_TaxRule_getTaxRule_OptionProductTaxRuleTest extends SC_Helper_TaxRule_TestBase
+{
+
+    protected function setUp()
+    {
+        parent::setUp();
+        $this->objTaxRule = new SC_Helper_TaxRule_Ex();
+    }
+
+    protected function tearDown()
+    {
+        parent::tearDown();
+    }
+
+    /////////////////////////////////////////
+
+    /**
+     * @test
+     */
+    public function 定数が正しく設定されているかのテスト()
+    {
+        $this->expected = 1;
+        $this->actual = constant('OPTION_PRODUCT_TAX_RULE');
+        $this->verify();
+    }
+
+    /**
+     * @test
+     */
+    /*
+    public function 引数がからの場合税率設定で設定かつ適用日時内の最新の値が返される()
+    {
+        $this->setUpTax();
+        $this->expected = array(
+            'apply_date' => '2014-01-01 00:00:00',
+            'tax_rate' => '5',
+            'product_id' => '0',
+            'product_class_id' => '0',
+            'del_flg' => '0'
+        );
+
+        $return = $this->objTaxRule->getTaxRule();
+        $this->actual = array(
+            'apply_date' => $return['apply_date'],
+            'tax_rate' => $return['tax_rate'],
+            'product_id' => $return['product_id'],
+            'product_class_id' => $return['product_class_id'],
+            'del_flg' => $return['del_flg']
+        );
+
+        $this->verify();
+    }*/
+}
Index: /branches/version-2_13-dev/tests/class/helper/SC_Helper_TaxRule/SC_Helper_TaxRule_getTaxRuleTest.php
===================================================================
--- /branches/version-2_13-dev/tests/class/helper/SC_Helper_TaxRule/SC_Helper_TaxRule_getTaxRuleTest.php	(revision 23331)
+++ /branches/version-2_13-dev/tests/class/helper/SC_Helper_TaxRule/SC_Helper_TaxRule_getTaxRuleTest.php	(revision 23331)
@@ -0,0 +1,59 @@
+<?php
+
+$HOME = realpath(dirname(__FILE__)) . "/../../../..";
+// 商品別税率機能無効
+define('OPTION_PRODUCT_TAX_RULE', 0);
+require_once($HOME . "/tests/class/helper/SC_Helper_TaxRule/SC_Helper_TaxRule_TestBase.php");
+
+class SC_Helper_TaxRule_getTaxRuleTest extends SC_Helper_TaxRule_TestBase
+{
+
+    protected function setUp()
+    {
+        parent::setUp();
+        $this->objTaxRule = new SC_Helper_TaxRule_Ex();
+    }
+
+    protected function tearDown()
+    {
+        parent::tearDown();
+    }
+
+    /////////////////////////////////////////
+
+    /**
+     * @test
+     */
+    public function 定数が正しく設定されているかのテスト()
+    {
+        $this->expected = 0;
+        $this->actual = constant('OPTION_PRODUCT_TAX_RULE');
+        $this->verify();
+    }
+
+    /**
+     * @test
+     */
+    public function 引数がからの場合税率設定で設定かつ適用日時内の最新の値が返される()
+    {
+        $this->setUpTax();
+        $this->expected = array(
+            'apply_date' => '2014-01-01 00:00:00',
+            'tax_rate' => '5',
+            'product_id' => '0',
+            'product_class_id' => '0',
+            'del_flg' => '0'
+        );
+
+        $return = $this->objTaxRule->getTaxRule();
+        $this->actual = array(
+            'apply_date' => $return['apply_date'],
+            'tax_rate' => $return['tax_rate'],
+            'product_id' => $return['product_id'],
+            'product_class_id' => $return['product_class_id'],
+            'del_flg' => $return['del_flg']
+        );
+
+        $this->verify();
+    }
+}
