source: branches/version-2_13-dev/tests/class/SC_Product/SC_Product_getListByProductIdsTest.php @ 23555

Revision 23555, 2.5 KB checked in by shutta, 10 years ago (diff)

#1993 [共通クラス]SC_Product
dtb_classテーブルのデータ初期化が漏れていたので追加。(必要なデータはクラス内で用意させる)
setUp周りの冗長な処理を改善。

Line 
1<?php
2
3$HOME = realpath(dirname(__FILE__)) . "/../../..";
4require_once($HOME . "/tests/class/SC_Product/SC_Product_TestBase.php");
5/**
6 *
7 */
8class SC_Product_getListsByProductIdsTest extends SC_Product_TestBase
9{
10
11    protected function setUp()
12    {
13        parent::setUp();
14        $this->setUpProductClass();
15        $this->objProducts = new SC_Product_Ex();
16    }
17
18    protected function tearDown()
19    {
20        parent::tearDown();
21    }
22
23    /////////////////////////////////////////
24
25    public function testGetListByProductIds_商品ID指定がない場合は空配列()
26    {
27        $this->expected = array();
28
29        $this->actual = $this->objProducts->getListByProductIds($this->objQuery);
30
31        $this->verify('商品ID指定なし');
32    }
33   
34    public function testGetListByProductIds_指定の商品IDで情報を取得する()
35    {
36        $arrProductId = array('1001');
37        //更新日を取得
38        $arrRet = $this->objQuery->getCol('update_date','dtb_products', 'product_id = 1001');
39
40        $this->expected = array(
41            '1001' => array(
42                'product_id' => '1001'
43                ,'product_code_min' => 'code1001'
44                ,'product_code_max' => 'code1001'
45                ,'name' => '製品名1001'
46                ,'comment1' => 'コメント10011'
47                ,'comment2' => 'コメント10012'
48                ,'comment3' => 'コメント10013'
49                ,'main_list_comment' => 'リストコメント1001'
50                ,'main_image' => '1001.jpg'
51                ,'main_list_image' => '1001-main.jpg'
52                ,'price01_min' => '1500'
53                ,'price01_max' => '1500'
54                ,'price02_min' => '1500'
55                ,'price02_max' => '1500'
56                ,'stock_min' => '99'
57                ,'stock_max' => '99'
58                ,'stock_unlimited_min' => '0'
59                ,'stock_unlimited_max' => '0'
60                ,'deliv_date_id' => '1'
61                ,'status' => '1'
62                ,'del_flg' => '0'
63                ,'update_date' => $arrRet[0]
64                ,'price01_min_inctax' => SC_Helper_TaxRule_Ex::sfCalcIncTax(1500)
65                ,'price01_max_inctax' => SC_Helper_TaxRule_Ex::sfCalcIncTax(1500)
66                ,'price02_min_inctax' => SC_Helper_TaxRule_Ex::sfCalcIncTax(1500)
67                ,'price02_max_inctax' => SC_Helper_TaxRule_Ex::sfCalcIncTax(1500)
68            )
69        );
70
71        $this->actual = $this->objProducts->getListByProductIds($this->objQuery, $arrProductId);
72
73        $this->verify('商品ID指定');
74    }
75}
Note: See TracBrowser for help on using the repository browser.