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

Revision 23555, 1.8 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_getProductsClassByQueryTest 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 testGetProductsClassByQuery_クエリに該当する商品情報を返す()
26    {
27        $this->expected = array(
28            0=> array(
29                'product_id' => '1001'
30                ,'del_flg' => '0'
31                ,'point_rate' => '0'
32                ,'stock' => '99'
33                ,'stock_unlimited' => '0'
34                ,'sale_limit' => null
35                ,'price01' => '1500'
36                ,'price02' => '1500'
37                ,'product_code' => 'code1001'
38                ,'product_class_id' => '1001'
39                ,'product_type_id' => '1'
40                ,'down_filename' => null
41                ,'down_realfilename' => null
42                ,'classcategory_name1' => 'cat1001'
43                ,'rank1' => '1'
44                ,'class_name1' => '味'
45                ,'class_id1' => '1'
46                ,'classcategory_id1' => '1001'
47                ,'classcategory_id2' => '1002'
48                ,'classcategory_name2' => 'cat1002'
49                ,'rank2' => '2'
50                ,'class_name2' => '味'
51                ,'class_id2' => '1'
52            )
53        );
54        $this->objQuery->setWhere('product_id = ?');
55
56        $this->actual = $this->objProducts->getProductsClassByQuery($this->objQuery, array('1001'));
57
58        $this->verify('商品情報クエリ');
59    }
60   
61}
Note: See TracBrowser for help on using the repository browser.