[Svn-src-all:3620] [version-2_12-dev 22532] #2040 (SC_Utils_Ex::sfGetProductClassIdで、$classcategory_id1 と $classcategory_id2 が使用されていない。)

undertree admin @ mail.ec-cube.net
2013年 2月 13日 (水) 13:28:14 JST


Subversion committed to /home/svn/open 22532
http://svn.ec-cube.net/open_trac/changeset/22532
┌────────────────────────────┐
│更新者 :  undertree                                    │
│更新日時:  2013-02-13 13:28:13 +0900 (水, 13  2月 2013)│
└────────────────────────────┘

Log:
--------------------------------------------------------
#2040 (SC_Utils_Ex::sfGetProductClassIdで、$classcategory_id1 と $classcategory_id2 が使用されていない。)
 ・テストケースの更新


Changed:                      [U:修正,A:追加,D:削除]
--------------------------------------------------------
U   branches/version-2_12-dev/tests/class/util/SC_Utils/SC_Utils_sfGetProductClassIdTest.php

変更: branches/version-2_12-dev/tests/class/util/SC_Utils/SC_Utils_sfGetProductClassIdTest.php
===================================================================
--- branches/version-2_12-dev/tests/class/util/SC_Utils/SC_Utils_sfGetProductClassIdTest.php	2013-02-13 03:53:08 UTC (rev 22531)
+++ branches/version-2_12-dev/tests/class/util/SC_Utils/SC_Utils_sfGetProductClassIdTest.php	2013-02-13 04:28:13 UTC (rev 22532)
@@ -44,16 +44,40 @@
   }
 
   /////////////////////////////////////////
-  public function testSfGetProductClassId_存在するIDを指定した場合_対応する製品クラスが取得できる() {
+  public function testSfGetProductClassId_存在する製品IDのみを指定した場合_カテゴリ0の対応する製品クラスが取得できる() {
     
-    $this->expected = '1001';
+    $this->expected = '2001';
+    $this->actual = SC_Utils::sfGetProductClassId('2001');
+
+    $this->verify('取得した製品クラス');
+  }
+
+  public function testSfGetProductClassId_存在する製品IDのみを指定してカテゴリ0の製品クラスが存在しなければ_nullが返る() {
+    
+    $this->expected = null;
     $this->actual = SC_Utils::sfGetProductClassId('1001');
 
+    $this->verify('取得結果が空');
+  }
+
+  public function testSfGetProductClassId_存在する製品IDとカテゴリIDを指定した場合_対応する製品クラスが取得できる() {
+    
+    $this->expected = '1002';
+    $this->actual = SC_Utils::sfGetProductClassId('1001', '2');
+
     $this->verify('取得した製品クラス');
   }
 
-  public function testSfGetProductClassId_存在しないIDを指定した場合_nullが返る() {
+  public function testSfGetProductClassId_存在する製品IDと存在しないカテゴリIDを指定した場合_nullが返る() {
+    
     $this->expected = null;
+    $this->actual = SC_Utils::sfGetProductClassId('1001', '999');
+
+    $this->verify('取得結果が空');
+  }
+
+  public function testSfGetProductClassId_存在しない製品IDを指定した場合_nullが返る() {
+    $this->expected = null;
     $this->actual = SC_Utils::sfGetProductClassId('9999');
 
     $this->verify('取得結果が空');
@@ -76,8 +100,7 @@
         'classcategory_id1' => '1',
         'creator_id' => '1',
         'update_date' => 'CURRENT_TIMESTAMP'
-      )
-      /** 同じproduct_idが2つあるケースは現状failするのでいったんコメントアウト
+      ),
       array(
         'product_class_id' => '1002',
         'product_id' => '1001',
@@ -86,7 +109,6 @@
         'creator_id' => '1',
         'update_date' => 'CURRENT_TIMESTAMP'
       )
-      */
     );
 
     $this->objQuery->delete('dtb_products_class');




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