[Svn-src-all:3931] [version-2_13-dev 22845] #150 (ユニットテスト環境の整備)

nanasess admin @ mail.ec-cube.net
2013年 5月 31日 (金) 19:02:47 JST


Subversion committed to /home/svn/open 22845
http://svn.ec-cube.net/open_trac/changeset/22845
┌────────────────────────────┐
│更新者 :  nanasess                                     │
│更新日時:  2013-05-31 19:02:47 +0900 (金, 31  5月 2013)│
└────────────────────────────┘

Log:
--------------------------------------------------------
#150 (ユニットテスト環境の整備)

 * 主に税率対応の仕様変更により通らなくなっていたテストを修正

#2193 税率チームのコミットをマージ

 * SC_Helper_Purchaseの 対応漏れ?を修正

Changed:                      [U:修正,A:追加,D:削除]
--------------------------------------------------------
U   branches/version-2_13-dev/data/class/helper/SC_Helper_Purchase.php
U   branches/version-2_13-dev/tests/class/SC_Product/SC_Product_getDetailAndProductsClassTest.php
U   branches/version-2_13-dev/tests/class/SC_Product/SC_Product_getDetailTest.php
U   branches/version-2_13-dev/tests/class/SC_Product/SC_Product_getListByProductIdsTest.php
U   branches/version-2_13-dev/tests/class/helper/SC_Helper_Address/SC_Helper_Address_getAddressTest.php
U   branches/version-2_13-dev/tests/class/helper/SC_Helper_Address/SC_Helper_Address_getListTest.php
U   branches/version-2_13-dev/tests/class/helper/SC_Helper_Address/SC_Helper_Address_registAddressTest.php
U   branches/version-2_13-dev/tests/class/helper/SC_Helper_DB/SC_Helper_DB_TestBase.php
U   branches/version-2_13-dev/tests/class/helper/SC_Helper_DB/SC_Helper_DB_sfGetBasisDataTest.php
U   branches/version-2_13-dev/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_copyFromCustomerTest.php
U   branches/version-2_13-dev/tests/class/util/SC_Utils/SC_Utils_isAppInnerUrlTest.php
U   branches/version-2_13-dev/tests/class/util/SC_Utils/SC_Utils_sfGetHashString_authTypePlainTest.php
U   branches/version-2_13-dev/tests/class/util/SC_Utils/SC_Utils_sfIsMatchHashPassword_authTypePlainTest.php
U   branches/version-2_13-dev/tests/class/util/SC_Utils/SC_Utils_sfPrintRTest.php

変更: branches/version-2_13-dev/data/class/helper/SC_Helper_Purchase.php
===================================================================
--- branches/version-2_13-dev/data/class/helper/SC_Helper_Purchase.php	2013-05-31 04:10:33 UTC (rev 22844)
+++ branches/version-2_13-dev/data/class/helper/SC_Helper_Purchase.php	2013-05-31 10:02:47 UTC (rev 22845)
@@ -371,7 +371,8 @@
             $arrItems['productsClass'] = $product;
         }
         $arrItems['price'] = $arrItems['productsClass']['price02'];
-        $inctax = SC_Helper_DB_Ex::sfCalcIncTax($arrItems['price']);
+        $inctax = SC_Helper_TaxRule_Ex::sfCalcIncTax($arrItems['price'], $arrItems['productsClass']['product_id'],
+                                                     $arrItems['productsClass']['product_class_id']);
         $arrItems['total_inctax'] = $inctax * $arrItems['quantity'];
     }
 

変更: branches/version-2_13-dev/tests/class/SC_Product/SC_Product_getDetailAndProductsClassTest.php
===================================================================
--- branches/version-2_13-dev/tests/class/SC_Product/SC_Product_getDetailAndProductsClassTest.php	2013-05-31 04:10:33 UTC (rev 22844)
+++ branches/version-2_13-dev/tests/class/SC_Product/SC_Product_getDetailAndProductsClassTest.php	2013-05-31 10:02:47 UTC (rev 22845)
@@ -53,10 +53,10 @@
                 ,'status' => '1'
                 ,'del_flg' => '0'
                 ,'update_date' => $arrRet[0]
-                ,'price01_min_inctax' => SC_Helper_DB_Ex::sfCalcIncTax('1500')
-                ,'price01_max_inctax' => SC_Helper_DB_Ex::sfCalcIncTax('1500')
-                ,'price02_min_inctax' => SC_Helper_DB_Ex::sfCalcIncTax('1500')
-                ,'price02_max_inctax' => SC_Helper_DB_Ex::sfCalcIncTax('1500')
+                ,'price01_min_inctax' => SC_Helper_TaxRule_Ex::sfCalcIncTax('1500')
+                ,'price01_max_inctax' => SC_Helper_TaxRule_Ex::sfCalcIncTax('1500')
+                ,'price02_min_inctax' => SC_Helper_TaxRule_Ex::sfCalcIncTax('1500')
+                ,'price02_max_inctax' => SC_Helper_TaxRule_Ex::sfCalcIncTax('1500')
                 ,'maker_id' => null
                 ,'comment4' => null
                 ,'comment5' => null

変更: branches/version-2_13-dev/tests/class/SC_Product/SC_Product_getDetailTest.php
===================================================================
--- branches/version-2_13-dev/tests/class/SC_Product/SC_Product_getDetailTest.php	2013-05-31 04:10:33 UTC (rev 22844)
+++ branches/version-2_13-dev/tests/class/SC_Product/SC_Product_getDetailTest.php	2013-05-31 10:02:47 UTC (rev 22845)
@@ -53,10 +53,10 @@
                 ,'status' => '1'
                 ,'del_flg' => '0'
                 ,'update_date' => $arrRet[0]
-                ,'price01_min_inctax' => SC_Helper_DB_Ex::sfCalcIncTax('1500')
-                ,'price01_max_inctax' => SC_Helper_DB_Ex::sfCalcIncTax('1500')
-                ,'price02_min_inctax' => SC_Helper_DB_Ex::sfCalcIncTax('1500')
-                ,'price02_max_inctax' => SC_Helper_DB_Ex::sfCalcIncTax('1500')
+                ,'price01_min_inctax' => SC_Helper_TaxRule_Ex::sfCalcIncTax('1500')
+                ,'price01_max_inctax' => SC_Helper_TaxRule_Ex::sfCalcIncTax('1500')
+                ,'price02_min_inctax' => SC_Helper_TaxRule_Ex::sfCalcIncTax('1500')
+                ,'price02_max_inctax' => SC_Helper_TaxRule_Ex::sfCalcIncTax('1500')
                 ,'maker_id' => null
                 ,'comment4' => null
                 ,'comment5' => null

変更: branches/version-2_13-dev/tests/class/SC_Product/SC_Product_getListByProductIdsTest.php
===================================================================
--- branches/version-2_13-dev/tests/class/SC_Product/SC_Product_getListByProductIdsTest.php	2013-05-31 04:10:33 UTC (rev 22844)
+++ branches/version-2_13-dev/tests/class/SC_Product/SC_Product_getListByProductIdsTest.php	2013-05-31 10:02:47 UTC (rev 22845)
@@ -68,10 +68,10 @@
                 ,'status' => '1'
                 ,'del_flg' => '0'
                 ,'update_date' => $arrRet[0]
-                ,'price01_min_inctax' => SC_Helper_DB_Ex::sfCalcIncTax('1500')
-                ,'price01_max_inctax' => SC_Helper_DB_Ex::sfCalcIncTax('1500')
-                ,'price02_min_inctax' => SC_Helper_DB_Ex::sfCalcIncTax('1500')
-                ,'price02_max_inctax' => SC_Helper_DB_Ex::sfCalcIncTax('1500')
+                ,'price01_min_inctax' => SC_Helper_TaxRule_Ex::sfCalcIncTax('1500')
+                ,'price01_max_inctax' => SC_Helper_TaxRule_Ex::sfCalcIncTax('1500')
+                ,'price02_min_inctax' => SC_Helper_TaxRule_Ex::sfCalcIncTax('1500')
+                ,'price02_max_inctax' => SC_Helper_TaxRule_Ex::sfCalcIncTax('1500')
             )
         );
 

変更: branches/version-2_13-dev/tests/class/helper/SC_Helper_Address/SC_Helper_Address_getAddressTest.php
===================================================================
--- branches/version-2_13-dev/tests/class/helper/SC_Helper_Address/SC_Helper_Address_getAddressTest.php	2013-05-31 04:10:33 UTC (rev 22844)
+++ branches/version-2_13-dev/tests/class/helper/SC_Helper_Address/SC_Helper_Address_getAddressTest.php	2013-05-31 10:02:47 UTC (rev 22845)
@@ -53,7 +53,8 @@
                 'tel03' => '0000',
                 'fax01' => '111',
                 'fax02' => '1111',
-                'fax03' => '1111'
+                'fax03' => '1111',
+                'country_id' => null
             );
         $this->actual = $this->objAddress->getAddress($other_deliv_id);
         

変更: branches/version-2_13-dev/tests/class/helper/SC_Helper_Address/SC_Helper_Address_getListTest.php
===================================================================
--- branches/version-2_13-dev/tests/class/helper/SC_Helper_Address/SC_Helper_Address_getListTest.php	2013-05-31 04:10:33 UTC (rev 22844)
+++ branches/version-2_13-dev/tests/class/helper/SC_Helper_Address/SC_Helper_Address_getListTest.php	2013-05-31 10:02:47 UTC (rev 22845)
@@ -43,7 +43,8 @@
                 'tel03' => '0000',
                 'fax01' => '111',
                 'fax02' => '1111',
-                'fax03' => '1111'
+                'fax03' => '1111',
+                'country_id' => null
                   )
 
                                 );
@@ -74,7 +75,8 @@
                 'tel03' => '0000',
                 'fax01' => '111',
                 'fax02' => '1111',
-                'fax03' => '1111'
+                'fax03' => '1111',
+                'country_id' => null
                   ),
             array(
                 'other_deliv_id' => '1000',
@@ -93,7 +95,8 @@
                 'tel03' => '0000',
                 'fax01' => '111',
                 'fax02' => '1111',
-                'fax03' => '1111'
+                'fax03' => '1111',
+                'country_id' => null
                   )
 
                                 );

変更: branches/version-2_13-dev/tests/class/helper/SC_Helper_Address/SC_Helper_Address_registAddressTest.php
===================================================================
--- branches/version-2_13-dev/tests/class/helper/SC_Helper_Address/SC_Helper_Address_registAddressTest.php	2013-05-31 04:10:33 UTC (rev 22844)
+++ branches/version-2_13-dev/tests/class/helper/SC_Helper_Address/SC_Helper_Address_registAddressTest.php	2013-05-31 10:02:47 UTC (rev 22845)
@@ -56,7 +56,8 @@
                     'tel03' => '0003',
                     'fax01' => '112',
                     'fax02' => '1113',
-                    'fax03' => '1114'
+                    'fax03' => '1114',
+                    'country_id' => null
                 );
             $objQuery =& SC_Query_Ex::getSingletonInstance();
             $this->expected = '1002';
@@ -93,7 +94,8 @@
                 'tel03' => '0003',
                 'fax01' => '112',
                 'fax02' => '1113',
-                'fax03' => '1114'
+                'fax03' => '1114',
+                'country_id' => null
             );
         $objQuery =& SC_Query_Ex::getSingletonInstance();
         $this->objAddress->registAddress($arrSql);

変更: branches/version-2_13-dev/tests/class/helper/SC_Helper_DB/SC_Helper_DB_TestBase.php
===================================================================
--- branches/version-2_13-dev/tests/class/helper/SC_Helper_DB/SC_Helper_DB_TestBase.php	2013-05-31 04:10:33 UTC (rev 22844)
+++ branches/version-2_13-dev/tests/class/helper/SC_Helper_DB/SC_Helper_DB_TestBase.php	2013-05-31 10:02:47 UTC (rev 22845)
@@ -155,5 +155,8 @@
         $this->objQuery->insert('dtb_baseinfo', $baseInfo);
     }   
 
-    
+    public function testDummyTest() {
+        // Warning が出るため空のテストを作成
+        $this->assertTrue(true);
+    }
 }

変更: branches/version-2_13-dev/tests/class/helper/SC_Helper_DB/SC_Helper_DB_sfGetBasisDataTest.php
===================================================================
--- branches/version-2_13-dev/tests/class/helper/SC_Helper_DB/SC_Helper_DB_sfGetBasisDataTest.php	2013-05-31 04:10:33 UTC (rev 22844)
+++ branches/version-2_13-dev/tests/class/helper/SC_Helper_DB/SC_Helper_DB_sfGetBasisDataTest.php	2013-05-31 10:02:47 UTC (rev 22845)
@@ -118,7 +118,7 @@
         $this->verify();
     }
 
-    
+    /* r22841 の仕様変更により廃止
     public function testsfGetBasisData_カラムを指定する場合_指定のカラムだけを返す()
     {
         $this->setUpBasisData();
@@ -131,11 +131,12 @@
         $this->actual = $this->helper->sfGetBasisData($force, $col);
         $this->verify();
     }
-    
+    */
+
     public function testsfGetBasisData_baseinfoが空の場合_空を返す()
     {
         $this->objQuery->delete('dtb_baseinfo');
-        $this->expected = array();
+        $this->expected = null;
         $this->actual = $this->helper->sfGetBasisData(true);
         $this->verify();
     }
@@ -144,15 +145,76 @@
     {
         $this->setUpBasisData();
         $force = true;
-        $col = 'id, company_name';
         //事前にキャッシュを生成
-        $this->actual = $this->helper->sfGetBasisData($force, $col);
+        $this->actual = $this->helper->sfGetBasisData($force);
         //baseinfoを空にしてしまう
         $this->objQuery->delete('dtb_baseinfo');
         $force = false;
         $this->expected = array(
             'id' => '1',
-            'company_name' => 'testshop'
+            'company_name' => 'testshop',
+            'company_kana' => 'テストショップ',
+            'zip01' => '530',
+            'zip02' => '0001',
+            'pref' => '1',
+            'addr01' => 'testaddr01',
+            'addr02' => 'testaddr02',
+            'tel01' => '11',
+            'tel02' => '2222',
+            'tel03' => '3333',
+            'fax01' => '11',
+            'fax02' => '2222',
+            'fax03' => '3333',
+            'business_hour' => '09-18',
+            'law_company' => 'lawcampanyname',
+            'law_manager' => 'lawmanager',
+            'law_zip01' => '530',
+            'law_zip02' => '0001',
+            'law_pref' => '1',
+            'law_addr01' => 'lawaddr01',
+            'law_addr02' => 'lawaddr02',
+            'law_tel01' => '11',
+            'law_tel02' => '2222',
+            'law_tel03' => '3333',
+            'law_fax01' => '11',
+            'law_fax02' => '2222',
+            'law_fax03' => '3333',
+            'law_email' => 'test @ test.com',
+            'law_url' => 'http://test.test',
+            'law_term01' => 'lawterm01',
+            'law_term02' => 'lawterm02',
+            'law_term03' => 'lawterm03',
+            'law_term04' => 'lawterm04',
+            'law_term05' => 'lawterm05',
+            'law_term06' => 'lawterm06',
+            'law_term07' => 'lawterm07',
+            'law_term08' => 'lawterm08',
+            'law_term09' => 'lawterm09',
+            'law_term10' => 'lawterm10',
+            'email01' => 'test1 @ test.com',
+            'email02' => 'test2 @ test.com',
+            'email03' => 'test3 @ test.com',
+            'email04' => 'test4 @ test.com',
+            'free_rule' => '1000',
+            'shop_name' => 'shopname',
+            'shop_kana' => 'ショップネーム',
+            'shop_name_eng' => 'shopnameeng',
+            'point_rate' => '10',
+            'welcome_point' => '100',
+            'update_date' => '2012-02-14 11:22:33',
+            'top_tpl' => 'top.tpl',
+            'product_tpl' => 'product.tpl',
+            'detail_tpl' => 'detail.tpl',
+            'mypage_tpl' => 'mypage.tpl',
+            'good_traded' => 'goodtraded',
+            'message' => 'message',
+            'regular_holiday_ids' => '0|6',
+            'latitude' => '30.0001',
+            'longitude' => '45.0001',
+            'downloadable_days' => '10',
+            'downloadable_days_unlimited' => '0',
+            'country_id' => null,
+            'law_country_id' => null
         );
         $this->actual = $this->helper->sfGetBasisData(false);
         $this->verify();

変更: branches/version-2_13-dev/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_copyFromCustomerTest.php
===================================================================
--- branches/version-2_13-dev/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_copyFromCustomerTest.php	2013-05-31 04:10:33 UTC (rev 22844)
+++ branches/version-2_13-dev/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_copyFromCustomerTest.php	2013-05-31 10:02:47 UTC (rev 22845)
@@ -112,7 +112,8 @@
       'order_birth' => '2012-01-01',
       'order_email' => 'mobile @ example.com',
       'customer_id' => '1001',
-      'update_date' => 'CURRENT_TIMESTAMP'
+      'update_date' => 'CURRENT_TIMESTAMP',
+      'order_country_id' => ''
     );
     $helper = new SC_Helper_Purchase();
     $helper->copyFromCustomer($dest, $this->customer);

変更: branches/version-2_13-dev/tests/class/util/SC_Utils/SC_Utils_isAppInnerUrlTest.php
===================================================================
--- branches/version-2_13-dev/tests/class/util/SC_Utils/SC_Utils_isAppInnerUrlTest.php	2013-05-31 04:10:33 UTC (rev 22844)
+++ branches/version-2_13-dev/tests/class/util/SC_Utils/SC_Utils_isAppInnerUrlTest.php	2013-05-31 10:02:47 UTC (rev 22845)
@@ -88,6 +88,9 @@
   */
 
   //////////////////////////////////////////
-
+    public function testDummyTest() {
+        // Warning が出るため空のテストを作成
+        $this->assertTrue(true);
+    }
 }
 

変更: branches/version-2_13-dev/tests/class/util/SC_Utils/SC_Utils_sfGetHashString_authTypePlainTest.php
===================================================================
--- branches/version-2_13-dev/tests/class/util/SC_Utils/SC_Utils_sfGetHashString_authTypePlainTest.php	2013-05-31 04:10:33 UTC (rev 22844)
+++ branches/version-2_13-dev/tests/class/util/SC_Utils/SC_Utils_sfGetHashString_authTypePlainTest.php	2013-05-31 10:02:47 UTC (rev 22845)
@@ -59,5 +59,9 @@
     $this->verify();
   }
   */
+      public function testDummyTest() {
+        // Warning が出るため空のテストを作成
+        $this->assertTrue(true);
+    }
 }
 

変更: branches/version-2_13-dev/tests/class/util/SC_Utils/SC_Utils_sfIsMatchHashPassword_authTypePlainTest.php
===================================================================
--- branches/version-2_13-dev/tests/class/util/SC_Utils/SC_Utils_sfIsMatchHashPassword_authTypePlainTest.php	2013-05-31 04:10:33 UTC (rev 22844)
+++ branches/version-2_13-dev/tests/class/util/SC_Utils/SC_Utils_sfIsMatchHashPassword_authTypePlainTest.php	2013-05-31 10:02:47 UTC (rev 22845)
@@ -71,5 +71,9 @@
     $this->verify('パスワード文字列比較結果');
   }
   */
+      public function testDummyTest() {
+        // Warning が出るため空のテストを作成
+        $this->assertTrue(true);
+      }
 }
 

変更: branches/version-2_13-dev/tests/class/util/SC_Utils/SC_Utils_sfPrintRTest.php
===================================================================
--- branches/version-2_13-dev/tests/class/util/SC_Utils/SC_Utils_sfPrintRTest.php	2013-05-31 04:10:33 UTC (rev 22844)
+++ branches/version-2_13-dev/tests/class/util/SC_Utils/SC_Utils_sfPrintRTest.php	2013-05-31 10:02:47 UTC (rev 22845)
@@ -65,6 +65,9 @@
   }
   */
   //////////////////////////////////////////
-
+    public function testDummyTest() {
+        // Warning が出るため空のテストを作成
+        $this->assertTrue(true);
+    }
 }
 




Svn-src-all メーリングリストの案内