1 | <?php |
---|
2 | |
---|
3 | $HOME = realpath(dirname(__FILE__)) . "/../../.."; |
---|
4 | require_once($HOME . "/tests/class/SC_Product/SC_Product_TestBase.php"); |
---|
5 | /** |
---|
6 | * |
---|
7 | */ |
---|
8 | class SC_Product_getProductsClassByProductIdsTest 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 testGetProductsClassByProductIds_商品IDなしは空配列を返す() { |
---|
22 | $this->setUpProductClass(); |
---|
23 | $this->setUpProducts(); |
---|
24 | $this->setUpClassCategory(); |
---|
25 | |
---|
26 | $this->expected = array(); |
---|
27 | |
---|
28 | $productIds = array(); |
---|
29 | |
---|
30 | $this->actual = $this->objProducts->getProductsClassByProductIds($productIds); |
---|
31 | |
---|
32 | $this->verify('商品ID指定なし'); |
---|
33 | } |
---|
34 | |
---|
35 | public function testGetProductsClassByProductIds_指定の商品IDの情報を返す() { |
---|
36 | $this->setUpProductClass(); |
---|
37 | $this->setUpProducts(); |
---|
38 | $this->setUpClassCategory(); |
---|
39 | |
---|
40 | $this->expected = array( |
---|
41 | 0=> array( |
---|
42 | 'product_id' => '1001' |
---|
43 | ,'del_flg' => '0' |
---|
44 | ,'point_rate' => '0' |
---|
45 | ,'stock' => '99' |
---|
46 | ,'stock_unlimited' => '0' |
---|
47 | ,'sale_limit' => null |
---|
48 | ,'price01' => '1500' |
---|
49 | ,'price02' => '1500' |
---|
50 | ,'product_code' => 'code1001' |
---|
51 | ,'product_class_id' => '1001' |
---|
52 | ,'product_type_id' => '1' |
---|
53 | ,'down_filename' => null |
---|
54 | ,'down_realfilename' => null |
---|
55 | ,'classcategory_name1' => 'cat1001' |
---|
56 | ,'rank1' => null |
---|
57 | ,'class_name1' => '味' |
---|
58 | ,'class_id1' => '1' |
---|
59 | ,'classcategory_id1' => '1001' |
---|
60 | ,'classcategory_id2' => '1002' |
---|
61 | ,'classcategory_name2' => 'cat1002' |
---|
62 | ,'rank2' => null |
---|
63 | ,'class_name2' => '味' |
---|
64 | ,'class_id2' => '1' |
---|
65 | ) |
---|
66 | ); |
---|
67 | |
---|
68 | $productIds = array('1001','2001'); |
---|
69 | |
---|
70 | $this->actual = $this->objProducts->getProductsClassByProductIds($productIds); |
---|
71 | |
---|
72 | $this->verify('商品ID指定'); |
---|
73 | } |
---|
74 | |
---|
75 | public function testGetProductsClassByProductIds_削除商品含む商品情報を返す() { |
---|
76 | $this->setUpProductClass(); |
---|
77 | $this->setUpProducts(); |
---|
78 | $this->setUpClassCategory(); |
---|
79 | |
---|
80 | $this->expected = array( |
---|
81 | 0=> array( |
---|
82 | 'product_id' => '1001' |
---|
83 | ,'del_flg' => '0' |
---|
84 | ,'point_rate' => '0' |
---|
85 | ,'stock' => '99' |
---|
86 | ,'stock_unlimited' => '0' |
---|
87 | ,'sale_limit' => null |
---|
88 | ,'price01' => '1500' |
---|
89 | ,'price02' => '1500' |
---|
90 | ,'product_code' => 'code1001' |
---|
91 | ,'product_class_id' => '1001' |
---|
92 | ,'product_type_id' => '1' |
---|
93 | ,'down_filename' => null |
---|
94 | ,'down_realfilename' => null |
---|
95 | ,'classcategory_name1' => 'cat1001' |
---|
96 | ,'rank1' => null |
---|
97 | ,'class_name1' => '味' |
---|
98 | ,'class_id1' => '1' |
---|
99 | ,'classcategory_id1' => '1001' |
---|
100 | ,'classcategory_id2' => '1002' |
---|
101 | ,'classcategory_name2' => 'cat1002' |
---|
102 | ,'rank2' => null |
---|
103 | ,'class_name2' => '味' |
---|
104 | ,'class_id2' => '1' |
---|
105 | ), |
---|
106 | 1=> array( |
---|
107 | 'product_id' => '2001' |
---|
108 | ,'del_flg' => '1' |
---|
109 | ,'point_rate' => '0' |
---|
110 | ,'stock' => null |
---|
111 | ,'stock_unlimited' => '1' |
---|
112 | ,'sale_limit' => null |
---|
113 | ,'price01' => null |
---|
114 | ,'price02' => '2000' |
---|
115 | ,'product_code' => 'code2001' |
---|
116 | ,'product_class_id' => '2001' |
---|
117 | ,'product_type_id' => '1' |
---|
118 | ,'down_filename' => null |
---|
119 | ,'down_realfilename' => null |
---|
120 | ,'classcategory_name1' => null |
---|
121 | ,'rank1' => null |
---|
122 | ,'class_name1' => null |
---|
123 | ,'class_id1' => null |
---|
124 | ,'classcategory_id1' => '0' |
---|
125 | ,'classcategory_id2' => '0' |
---|
126 | ,'classcategory_name2' => null |
---|
127 | ,'rank2' => null |
---|
128 | ,'class_name2' => null |
---|
129 | ,'class_id2' => null |
---|
130 | ) |
---|
131 | ); |
---|
132 | |
---|
133 | $productIds = array('1001','2001'); |
---|
134 | |
---|
135 | $this->actual = $this->objProducts->getProductsClassByProductIds($productIds,true); |
---|
136 | |
---|
137 | $this->verify('商品ID指定'); |
---|
138 | } |
---|
139 | |
---|
140 | |
---|
141 | } |
---|