Changeset 22190
- Timestamp:
- 2013/01/03 16:45:17 (11 years ago)
- Location:
- branches/version-2_12-dev/tests/class/SC_Product
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_12-dev/tests/class/SC_Product/SC_Product_TestBase.php
r22188 r22190 24 24 'product_class_id' => '1001', 25 25 'product_id' => '1001', 26 'product_type_id' => '1 001',26 'product_type_id' => '1', 27 27 'product_code' => 'code1001', 28 28 'classcategory_id1' => '1001', … … 30 30 'price01' => '1500', 31 31 'price02' => '1500', 32 'stock' => '99', 32 33 'creator_id' => '1', 33 34 'del_flg' => '0' … … 37 38 'product_class_id' => '1002', 38 39 'product_id' => '1002', 39 'product_type_id' => '1002', 40 'product_type_id' => '2', 41 'product_code' => 'code1002', 40 42 'price02' => '2500', 41 43 'creator_id' => '1', 44 'stock_unlimited' => '1', 42 45 'del_flg' => '0' 46 ), 47 array( 48 'update_date' => 'CURRENT_TIMESTAMP', 49 'product_class_id' => '2001', 50 'product_id' => '2001', 51 'product_type_id' => '1', 52 'product_code' => 'code2001', 53 'price02' => '2000', 54 'creator_id' => '1', 55 'stock_unlimited' => '1', 56 'del_flg' => '1' 43 57 ) 44 58 ); … … 88 102 'product_id' => '1001', 89 103 'name' => '製品名1001', 104 'comment1' => 'コメント10011', 105 'comment2' => 'コメント10012', 106 'comment3' => 'コメント10013', 107 'main_list_comment' => 'リストコメント1001', 108 'main_comment' => 'メインコメント1001', 109 'main_image' => '1001.jpg', 110 'main_list_image' => '1001-main.jpg', 111 'deliv_date_id' => '1', 90 112 'del_flg' => '0', 91 113 'creator_id' => '1', … … 96 118 'product_id' => '1002', 97 119 'name' => '製品名1002', 120 'comment1' => 'コメント10021', 121 'comment2' => 'コメント10022', 122 'comment3' => 'コメント10023', 123 'main_list_comment' => 'リストコメント1002', 124 'main_image' => '1002.jpg', 125 'main_list_image' => '1002-main.jpg', 126 'deliv_date_id' => '2', 98 127 'del_flg' => '0', 99 128 'creator_id' => '1', 100 129 'status' => '2' 130 ), 131 array( 132 'update_date' => 'CURRENT_TIMESTAMP', 133 'product_id' => '2001', 134 'name' => '製品名2001', 135 'comment1' => 'コメント20011', 136 'comment2' => 'コメント20012', 137 'comment3' => 'コメント20013', 138 'main_list_comment' => 'リストコメント2001', 139 'main_comment' => 'メインコメント2001', 140 'main_image' => '2001.jpg', 141 'main_list_image' => '2001-main.jpg', 142 'deliv_date_id' => '1', 143 'del_flg' => '1', 144 'creator_id' => '1', 145 'status' => '1' 101 146 ) 102 147 ); … … 107 152 } 108 153 } 154 155 /** 156 * DBに商品ステータス情報を登録します. 157 */ 158 protected function setUpProductStatus() { 159 $class_category = array( 160 array( 161 'update_date' => 'CURRENT_TIMESTAMP', 162 'product_status_id' => '1', 163 'product_id' => '1001', 164 'creator_id' => '1', 165 'del_flg' => '0' 166 ), 167 array( 168 'update_date' => 'CURRENT_TIMESTAMP', 169 'product_status_id' => '1', 170 'product_id' => '1002', 171 'creator_id' => '1', 172 'del_flg' => '0' 173 ) 174 ); 175 176 $this->objQuery->delete('dtb_product_status'); 177 foreach ($class_category as $key => $item) { 178 $this->objQuery->insert('dtb_product_status', $item); 179 } 180 } 109 181 } -
branches/version-2_12-dev/tests/class/SC_Product/SC_Product_findProductIdsOrderTest.php
r22189 r22190 26 26 // 商品ID降順で商品IDを取得する 27 27 $this->objQuery->setOrder('product_id DESC'); 28 $this->expected = array(' 1002', '1001');28 $this->expected = array('2001','1002', '1001'); 29 29 30 30 $this->actual = $this->objProducts->findProductIdsOrder($this->objQuery); … … 40 40 // 商品名昇順で商品IDを取得する 41 41 $this->objQuery->setOrder('product_id ASC'); 42 $this->expected = array('1001', '1002' );42 $this->expected = array('1001', '1002','2001'); 43 43 44 44 $this->actual = $this->objProducts->findProductIdsOrder($this->objQuery); … … 46 46 $this->verify('商品ID昇順'); 47 47 } 48 49 public function testFindProductIdsOrder_arrOrderData設定時() { 50 $this->setUpProductClass(); 51 $this->setUpProducts(); 52 $this->setUpClassCategory(); 53 54 // setProductsOrderを行う 55 $this->objProducts->setProductsOrder('product_id'); 56 $this->expected = array('1001', '1002','2001'); 57 58 $this->actual = $this->objProducts->findProductIdsOrder($this->objQuery); 59 60 $this->verify('arrOrderData設定時'); 61 } 62 48 63 }
Note: See TracChangeset
for help on using the changeset viewer.