Changeset 22190


Ignore:
Timestamp:
2013/01/03 16:45:17 (11 years ago)
Author:
poego
Message:

#1993 SC_Productテストケース作成

Location:
branches/version-2_12-dev/tests/class/SC_Product
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_12-dev/tests/class/SC_Product/SC_Product_TestBase.php

    r22188 r22190  
    2424                'product_class_id' => '1001', 
    2525                'product_id' => '1001', 
    26                 'product_type_id' => '1001', 
     26                'product_type_id' => '1', 
    2727                'product_code' => 'code1001', 
    2828                'classcategory_id1' => '1001', 
     
    3030                'price01' => '1500', 
    3131                'price02' => '1500', 
     32                'stock' => '99', 
    3233                'creator_id' => '1', 
    3334                'del_flg' => '0' 
     
    3738                'product_class_id' => '1002', 
    3839                'product_id' => '1002', 
    39                 'product_type_id' => '1002', 
     40                'product_type_id' => '2', 
     41                'product_code' => 'code1002', 
    4042                'price02' => '2500', 
    4143                'creator_id' => '1', 
     44                'stock_unlimited' => '1', 
    4245                'del_flg' => '0' 
     46                  ), 
     47            array( 
     48                'update_date' => 'CURRENT_TIMESTAMP', 
     49                'product_class_id' => '2001', 
     50                'product_id' => '2001', 
     51                'product_type_id' => '1', 
     52                'product_code' => 'code2001', 
     53                'price02' => '2000', 
     54                'creator_id' => '1', 
     55                'stock_unlimited' => '1', 
     56                'del_flg' => '1' 
    4357                  ) 
    4458                               ); 
     
    88102                'product_id' => '1001', 
    89103                'name' => '製品名1001', 
     104                'comment1' => 'コメント10011', 
     105                'comment2' => 'コメント10012', 
     106                'comment3' => 'コメント10013', 
     107                'main_list_comment' => 'リストコメント1001', 
     108                'main_comment' => 'メインコメント1001', 
     109                'main_image' => '1001.jpg', 
     110                'main_list_image' => '1001-main.jpg', 
     111                'deliv_date_id' => '1', 
    90112                'del_flg' => '0', 
    91113                'creator_id' => '1', 
     
    96118                'product_id' => '1002', 
    97119                'name' => '製品名1002', 
     120                'comment1' => 'コメント10021', 
     121                'comment2' => 'コメント10022', 
     122                'comment3' => 'コメント10023', 
     123                'main_list_comment' => 'リストコメント1002', 
     124                'main_image' => '1002.jpg', 
     125                'main_list_image' => '1002-main.jpg', 
     126                'deliv_date_id' => '2', 
    98127                'del_flg' => '0', 
    99128                'creator_id' => '1', 
    100129                'status' => '2' 
     130                  ), 
     131            array( 
     132                'update_date' => 'CURRENT_TIMESTAMP', 
     133                'product_id' => '2001', 
     134                'name' => '製品名2001', 
     135                'comment1' => 'コメント20011', 
     136                'comment2' => 'コメント20012', 
     137                'comment3' => 'コメント20013', 
     138                'main_list_comment' => 'リストコメント2001', 
     139                'main_comment' => 'メインコメント2001', 
     140                'main_image' => '2001.jpg', 
     141                'main_list_image' => '2001-main.jpg', 
     142                'deliv_date_id' => '1', 
     143                'del_flg' => '1', 
     144                'creator_id' => '1', 
     145                'status' => '1' 
    101146                  ) 
    102147                          ); 
     
    107152        } 
    108153    } 
     154     
     155    /** 
     156     * DBに商品ステータス情報を登録します. 
     157     */ 
     158    protected function setUpProductStatus() { 
     159        $class_category = array( 
     160            array( 
     161                'update_date' => 'CURRENT_TIMESTAMP', 
     162                'product_status_id' => '1', 
     163                'product_id' => '1001', 
     164                'creator_id' => '1', 
     165                'del_flg' => '0' 
     166                  ), 
     167            array( 
     168                'update_date' => 'CURRENT_TIMESTAMP', 
     169                'product_status_id' => '1', 
     170                'product_id' => '1002', 
     171                'creator_id' => '1', 
     172                'del_flg' => '0' 
     173                  ) 
     174                                ); 
     175 
     176        $this->objQuery->delete('dtb_product_status'); 
     177        foreach ($class_category as $key => $item) { 
     178            $this->objQuery->insert('dtb_product_status', $item); 
     179        } 
     180    } 
    109181} 
  • branches/version-2_12-dev/tests/class/SC_Product/SC_Product_findProductIdsOrderTest.php

    r22189 r22190  
    2626        // 商品ID降順で商品IDを取得する 
    2727        $this->objQuery->setOrder('product_id DESC'); 
    28         $this->expected = array('1002', '1001'); 
     28        $this->expected = array('2001','1002', '1001'); 
    2929 
    3030        $this->actual = $this->objProducts->findProductIdsOrder($this->objQuery); 
     
    4040        // 商品名昇順で商品IDを取得する 
    4141        $this->objQuery->setOrder('product_id ASC'); 
    42         $this->expected = array('1001', '1002'); 
     42        $this->expected = array('1001', '1002','2001'); 
    4343 
    4444        $this->actual = $this->objProducts->findProductIdsOrder($this->objQuery); 
     
    4646        $this->verify('商品ID昇順'); 
    4747    } 
     48     
     49    public function testFindProductIdsOrder_arrOrderData設定時() { 
     50        $this->setUpProductClass(); 
     51        $this->setUpProducts(); 
     52        $this->setUpClassCategory(); 
     53 
     54        // setProductsOrderを行う 
     55        $this->objProducts->setProductsOrder('product_id'); 
     56        $this->expected = array('1001', '1002','2001'); 
     57 
     58        $this->actual = $this->objProducts->findProductIdsOrder($this->objQuery); 
     59 
     60        $this->verify('arrOrderData設定時'); 
     61    } 
     62     
    4863} 
Note: See TracChangeset for help on using the changeset viewer.