source: branches/version-2_12-dev/tests/class/SC_Product/SC_Product_getListByProductIdsTest.php @ 22484

Revision 22484, 2.7 KB checked in by Seasoft, 11 years ago (diff)

#2091 (拡張クラスを使っていない)

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