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

Revision 22796, 2.6 KB checked in by h_yoshimoto, 8 years ago (diff)

#2236 2.12.3リリース以降の2.12-devへのコミット差し戻し

RevLine 
[22191]1<?php
2
3$HOME = realpath(dirname(__FILE__)) . "/../../..";
4require_once($HOME . "/tests/class/SC_Product/SC_Product_TestBase.php");
5/**
6 *
7 */
[22796]8class SC_Product_getListsByProductIdsTest extends SC_Product_TestBase {
[22191]9
[22796]10    protected function setUp() {
[22191]11        parent::setUp();
12        $this->objProducts = new SC_Product_Ex();
13    }
14
[22796]15    protected function tearDown() {
[22191]16        parent::tearDown();
17    }
18
19    /////////////////////////////////////////
20
[22796]21    public function testGetListByProductIds_商品ID指定がない場合は空配列() {
[22191]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   
[22796]33    public function testGetListByProductIds_指定の商品IDで情報を取得する() {
[22191]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]
[22796]66                ,'price01_min_inctax' => SC_Helper_DB::sfCalcIncTax('1500')
67                ,'price01_max_inctax' => SC_Helper_DB::sfCalcIncTax('1500')
68                ,'price02_min_inctax' => SC_Helper_DB::sfCalcIncTax('1500')
69                ,'price02_max_inctax' => SC_Helper_DB::sfCalcIncTax('1500')
[22191]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.