source: branches/version-2_13-dev/tests/class/SC_Product/SC_Product_getProductsClassByProductIdsTest.php @ 23540

Revision 23540, 4.6 KB checked in by shutta, 10 years ago (diff)

#2588 商品管理>商品登録(商品規格) dtb_classcategory.del_flg を関知していない
テストケースで失敗するようになっているものが出ていたので修正。

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_getProductsClassByProductIdsTest extends SC_Product_TestBase
9{
10
11    protected function setUp()
12    {
13        parent::setUp();
14        $this->objProducts = new SC_Product_Ex();
15    }
16
17    protected function tearDown()
18    {
19        parent::tearDown();
20    }
21
22    /////////////////////////////////////////
23
24    public function testGetProductsClassByProductIds_商品IDなしは空配列を返す()
25    {
26        $this->setUpProductClass();
27        $this->setUpProducts();
28        $this->setUpClassCategory();
29
30        $this->expected = array();
31       
32        $productIds = array();
33
34        $this->actual = $this->objProducts->getProductsClassByProductIds($productIds);
35
36        $this->verify('商品ID指定なし');
37    }
38   
39    public function testGetProductsClassByProductIds_指定の商品IDの情報を返す()
40    {
41        $this->setUpProductClass();
42        $this->setUpProducts();
43        $this->setUpClassCategory();
44
45        $this->expected = array(
46            0=> array(
47                'product_id' => '1001'
48                ,'del_flg' => '0'
49                ,'point_rate' => '0'
50                ,'stock' => '99'
51                ,'stock_unlimited' => '0'
52                ,'sale_limit' => null
53                ,'price01' => '1500'
54                ,'price02' => '1500'
55                ,'product_code' => 'code1001'
56                ,'product_class_id' => '1001'
57                ,'product_type_id' => '1'
58                ,'down_filename' => null
59                ,'down_realfilename' => null
60                ,'classcategory_name1' => 'cat1001'
61                ,'rank1' => null
62                ,'class_name1' => '味'
63                ,'class_id1' => '1'
64                ,'classcategory_id1' => '1001'
65                ,'classcategory_id2' => '1002'
66                ,'classcategory_name2' => 'cat1002'
67                ,'rank2' => null
68                ,'class_name2' => '味'
69                ,'class_id2' => '1'
70            )
71        );
72       
73        $productIds = array('1001','2001');
74
75        $this->actual = $this->objProducts->getProductsClassByProductIds($productIds);
76
77        $this->verify('商品ID指定');
78    }
79   
80    public function testGetProductsClassByProductIds_削除商品含む商品情報を返す()
81    {
82        $this->setUpProductClass();
83        $this->setUpProducts();
84        $this->setUpClassCategory();
85
86        $this->expected = array(
87            0=> array(
88                'product_id' => '1001'
89                ,'del_flg' => '0'
90                ,'point_rate' => '0'
91                ,'stock' => '99'
92                ,'stock_unlimited' => '0'
93                ,'sale_limit' => null
94                ,'price01' => '1500'
95                ,'price02' => '1500'
96                ,'product_code' => 'code1001'
97                ,'product_class_id' => '1001'
98                ,'product_type_id' => '1'
99                ,'down_filename' => null
100                ,'down_realfilename' => null
101                ,'classcategory_name1' => 'cat1001'
102                ,'rank1' => null
103                ,'class_name1' => '味'
104                ,'class_id1' => '1'
105                ,'classcategory_id1' => '1001'
106                ,'classcategory_id2' => '1002'
107                ,'classcategory_name2' => 'cat1002'
108                ,'rank2' => null
109                ,'class_name2' => '味'
110                ,'class_id2' => '1'
111            ),
112            1=> array(
113                'product_id' => '2001'
114                ,'del_flg' => '1'
115                ,'point_rate' => '0'
116                ,'stock' => null
117                ,'stock_unlimited' => '1'
118                ,'sale_limit' => null
119                ,'price01' => null
120                ,'price02' => '2000'
121                ,'product_code' => 'code2001'
122                ,'product_class_id' => '2001'
123                ,'product_type_id' => '1'
124                ,'down_filename' => null
125                ,'down_realfilename' => null
126                ,'classcategory_name1' => null
127                ,'rank1' => 0
128                ,'class_name1' => null
129                ,'class_id1' => null
130                ,'classcategory_id1' => '0'
131                ,'classcategory_id2' => '0'
132                ,'classcategory_name2' => null
133                ,'rank2' => 0
134                ,'class_name2' => null
135                ,'class_id2' => null
136            )
137        );
138       
139        $productIds = array('1001','2001');
140
141        $this->actual = $this->objProducts->getProductsClassByProductIds($productIds,true);
142
143        $this->verify('商品ID指定');
144    }
145   
146   
147}
Note: See TracBrowser for help on using the repository browser.