Changeset 22278 for branches/version-2_12-multilang/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_TestBase.php
- Timestamp:
- 2013/01/18 17:04:44 (11 years ago)
- Location:
- branches/version-2_12-multilang
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_12-multilang
- Property svn:mergeinfo changed
/branches/version-2_12-dev merged: 22145-22146,22158,22164-22165,22167-22169,22187-22196,22199-22204,22231,22241 /branches/version-2_12_3 (added) merged: 22219,22229,22259-22261
- Property svn:mergeinfo changed
-
branches/version-2_12-multilang/tests
- Property svn:ignore
-
old new 1 1 phpunit.xml 2 2 require.php 3 tmp 3 4
-
- Property svn:ignore
-
branches/version-2_12-multilang/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_TestBase.php
r22144 r22278 3 3 $HOME = realpath(dirname(__FILE__)) . "/../../../.."; 4 4 require_once($HOME . "/tests/class/Common_TestCase.php"); 5 /* 6 * This file is part of EC-CUBE 7 * 8 * Copyright(c) 2000-2012 LOCKON CO.,LTD. All Rights Reserved. 9 * 10 * http://www.lockon.co.jp/ 11 * 12 * This program is free software; you can redistribute it and/or 13 * modify it under the terms of the GNU General Public License 14 * as published by the Free Software Foundation; either version 2 15 * of the License, or (at your option) any later version. 16 * 17 * This program is distributed in the hope that it will be useful, 18 * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 * GNU General Public License for more details. 21 * 22 * You should have received a copy of the GNU General Public License 23 * along with this program; if not, write to the Free Software 24 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 25 */ 5 26 /** 6 * 27 * SC_Helper_Purchaseのテストの基底クラス. 28 * 29 * 30 * @author Hiroko Tamagawa 31 * @version $Id$ 7 32 */ 8 33 class SC_Helper_Purchase_TestBase extends Common_TestCase { … … 22 47 protected function setUpShipping($shipping) { 23 48 if (!$shipping) { 24 $shipping = getSingleShipping();49 $shipping = $this->getSingleShipping(); 25 50 } 26 51 … … 60 85 $shippings = array( 61 86 array( 87 'update_date' => '2000-01-01 00:00:00', 62 88 'shipping_id' => '1', 63 89 'order_id' => '1', … … 66 92 ), 67 93 array( 94 'update_date' => '2000-01-01 00:00:00', 68 95 'shipping_id' => '2', 69 96 'order_id' => '2', 70 97 'shipping_name01' => '配送情報02', 71 98 'shipping_date' => '2011-10-01' 99 ), 100 array( 101 'update_date' => '2000-01-01 00:00:00', 102 'shipping_id' => '1002', 103 'order_id' => '1002', 104 'shipping_time' => '午後', 105 'time_id' => '1' 72 106 ) 73 107 ); 74 108 109 $this->objQuery->delete('dtb_shipping'); 75 110 foreach ($shippings as $key => $item) { 76 111 $this->objQuery->insert('dtb_shipping', $item); … … 99 134 ); 100 135 136 $this->objQuery->delete('dtb_shipment_item'); 101 137 foreach ($shipping_items as $key => $item) { 102 138 $this->objQuery->insert('dtb_shipment_item', $item); … … 111 147 $product_class = array( 112 148 array( 149 'update_date' => '2000-01-01 00:00:00', 113 150 'product_class_id' => '1001', 114 151 'product_id' => '1001', 115 'product_type_id' => '1 001',152 'product_type_id' => '1', 116 153 'product_code' => 'code1001', 117 154 'classcategory_id1' => '1001', … … 119 156 'price01' => '1500', 120 157 'price02' => '1500', 158 'creator_id' => '1', 121 159 'del_flg' => '0' 122 160 ), 123 161 array( 162 'update_date' => '2000-01-01 00:00:00', 124 163 'product_class_id' => '1002', 125 164 'product_id' => '1002', 126 'product_type_id' => '1002', 165 'product_type_id' => '2', 166 'price02' => '2500', 167 'creator_id' => '1', 127 168 'del_flg' => '0' 128 169 ) 129 170 ); 130 171 172 $this->objQuery->delete('dtb_products_class'); 131 173 foreach ($product_class as $key => $item) { 132 174 $this->objQuery->insert('dtb_products_class', $item); … … 142 184 $class_category = array( 143 185 array( 186 'update_date' => '2000-01-01 00:00:00', 144 187 'classcategory_id' => '1001', 188 'class_id' => '1', 189 'creator_id' => '1', 145 190 'name' => 'cat1001' 146 191 ), 147 192 array( 193 'update_date' => '2000-01-01 00:00:00', 148 194 'classcategory_id' => '1002', 195 'class_id' => '1', 196 'creator_id' => '1', 149 197 'name' => 'cat1002' 150 198 ) 151 199 ); 152 200 201 $this->objQuery->delete('dtb_classcategory'); 153 202 foreach ($class_category as $key => $item) { 154 203 $this->objQuery->insert('dtb_classcategory', $item); … … 162 211 $products = array( 163 212 array( 213 'update_date' => '2000-01-01 00:00:00', 164 214 'product_id' => '1001', 165 215 'name' => '製品名1001', 166 216 'del_flg' => '0', 217 'creator_id' => '1', 167 218 'status' => '1' 168 219 ), 169 220 array( 221 'update_date' => '2000-01-01 00:00:00', 170 222 'product_id' => '1002', 171 223 'name' => '製品名1002', 172 224 'del_flg' => '0', 225 'creator_id' => '1', 173 226 'status' => '2' 174 227 ) 175 228 ); 176 229 230 $this->objQuery->delete('dtb_products'); 177 231 foreach ($products as $key => $item) { 178 232 $this->objQuery->insert('dtb_products', $item); … … 227 281 ); 228 282 283 $this->objQuery->delete('dtb_payment_options'); 229 284 foreach ($payment_options as $key => $item) { 230 285 $this->objQuery->insert('dtb_payment_options', $item); … … 242 297 'name' => '配送業者del', 243 298 'rank' => '1', 244 'del_flg' => '1' 299 'creator_id' => '1', 300 'del_flg' => '1', 301 'update_date' => '2000-01-01 00:00:00' 245 302 ), 246 303 array( … … 248 305 'product_type_id' => '1001', 249 306 'name' => '配送業者01', 250 'rank' => '2' 307 'creator_id' => '1', 308 'rank' => '2', 309 'update_date' => '2000-01-01 00:00:00' 251 310 ), 252 311 array( … … 254 313 'product_type_id' => '1001', 255 314 'name' => '配送業者02', 256 'rank' => '3' 315 'creator_id' => '1', 316 'rank' => '3', 317 'update_date' => '2000-01-01 00:00:00' 257 318 ), 258 319 array( // 商品種別違い … … 260 321 'product_type_id' => '2001', 261 322 'name' => '配送業者21', 262 'rank' => '4' 263 ), 264 ); 265 323 'creator_id' => '1', 324 'rank' => '4', 325 'update_date' => '2000-01-01 00:00:00' 326 ), 327 ); 328 329 $this->objQuery->delete('dtb_deliv'); 266 330 foreach ($deliv as $key => $item) { 267 331 $this->objQuery->insert('dtb_deliv', $item); … … 291 355 ); 292 356 357 $this->objQuery->delete('dtb_delivtime'); 293 358 foreach ($deliv_time as $key => $item) { 294 359 $this->objQuery->insert('dtb_delivtime', $item); … … 302 367 $payment = array( 303 368 array( 369 'update_date' => '2000-01-01 00:00:00', 304 370 'payment_id' => '1001', 371 'creator_id' => '1', 305 372 'payment_method' => '支払方法1001' 306 373 ), 307 374 array( 375 'update_date' => '2000-01-01 00:00:00', 308 376 'payment_id' => '1002', 377 'creator_id' => '1', 309 378 'payment_method' => '支払方法1002', 310 379 'del_flg' => '1' 311 380 ), 312 381 array( 382 'update_date' => '2000-01-01 00:00:00', 313 383 'payment_id' => '1003', 384 'creator_id' => '1', 314 385 'payment_method' => '支払方法1003' 315 386 ), 316 387 array( 388 'update_date' => '2000-01-01 00:00:00', 317 389 'payment_id' => '3001', 390 'creator_id' => '1', 318 391 'payment_method' => '支払方法3001', 319 392 'del_flg' => '1' 320 393 ), 321 394 array( 395 'update_date' => '2000-01-01 00:00:00', 322 396 'payment_id' => '3002', 397 'creator_id' => '1', 323 398 'payment_method' => '支払方法3002' 324 399 ), 325 400 array( 401 'update_date' => '2000-01-01 00:00:00', 326 402 'payment_id' => '3003', 403 'creator_id' => '1', 327 404 'payment_method' => '支払方法3003', 328 405 'rule_max' => 10000 329 406 ), 330 407 array( 408 'update_date' => '2000-01-01 00:00:00', 331 409 'payment_id' => '3004', 410 'creator_id' => '1', 332 411 'payment_method' => '支払方法3004', 333 412 'upper_rule' => 20000 334 413 ), 335 414 array( 415 'update_date' => '2000-01-01 00:00:00', 336 416 'payment_id' => '3005', 417 'creator_id' => '1', 337 418 'payment_method' => '支払方法3005', 338 419 'rule_max' => 12000, … … 341 422 ); 342 423 424 $this->objQuery->delete('dtb_payment'); 343 425 foreach ($payment as $key => $item) { 344 426 $this->objQuery->insert('dtb_payment', $item); … … 352 434 $order = array( 353 435 array( 436 'update_date' => '2000-01-01 00:00:00', 354 437 'order_id' => '1001', 355 438 'customer_id' => '1001', 356 439 'order_name01' => '受注情報01', 357 440 'status' => '3', 358 'payment_date' => '2032-12-31 01:20:30' // 日付が変わっても良いように、遠い未来に設定 441 'payment_date' => '2032-12-31 01:20:30', // 日付が変わっても良いように、遠い未来に設定 442 'use_point' => '10', 443 'add_point' => '20' 359 444 ), 360 445 array( 446 'update_date' => '2000-01-01 00:00:00', 361 447 'order_id' => '1002', 362 448 'customer_id' => '1002', 363 'order_name01' => '受注情報02' 449 'order_name01' => '受注情報02', 450 'status' => '5', 451 'payment_id' => '1002', 452 'payment_method' => '支払方法1001', 453 'deliv_id' => '1002', 454 'use_point' => '10', 455 'add_point' => '20' 364 456 ) 365 457 ); 366 458 459 $this->objQuery->delete('dtb_order'); 367 460 foreach ($order as $item) { 368 461 $this->objQuery->insert('dtb_order', $item); … … 376 469 $order = array( 377 470 array( 471 'update_date' => '2000-01-01 00:00:00', 378 472 'order_temp_id' => '1001', 379 473 'customer_id' => '1001', 380 'order_name01' => '受注情報01' 474 'order_name01' => '受注情報01', 475 'order_id' => '1001' 381 476 ), 382 477 array( 478 'update_date' => '2000-01-01 00:00:00', 383 479 'order_temp_id' => '1002', 384 480 'customer_id' => '1002', 385 'order_name01' => '受注情報02' 481 'order_name01' => '受注情報02', 482 'payment_id' => '1002', 483 'payment_method' => '支払方法1001' 386 484 ) 387 485 ); 388 486 487 $this->objQuery->delete('dtb_order_temp'); 389 488 foreach ($order as $item) { 390 489 $this->objQuery->insert('dtb_order_temp', $item); … … 408 507 'price' => 3000, 409 508 'quantity' => 10, 410 'point_rate' => 5 509 'point_rate' => 5, 510 'tax_rate' => 5, 511 'tax_rule' => 0 411 512 ), 412 513 array( … … 421 522 'price' => 4000, 422 523 'quantity' => 15, 423 'point_rate' => 6 524 'point_rate' => 6, 525 'tax_rate' => 3, 526 'tax_rule' => 1 424 527 ), 425 528 array( … … 427 530 'order_id' => '1002', 428 531 'product_id' => '1001', 429 'product_class_id' => '1001' 532 'product_class_id' => '1001', 533 'product_name' => '製品名1003' 430 534 ) 431 535 ); 432 536 537 $this->objQuery->delete('dtb_order_detail'); 433 538 foreach ($order_detail as $item) { 434 539 $this->objQuery->insert('dtb_order_detail', $item); … … 436 541 } 437 542 543 /** 544 * DBに顧客情報を設定します。 545 */ 546 protected function setUpCustomer() { 547 $customer = array( 548 array( 549 'customer_id' => '1001', 550 'name01' => '苗字', 551 'name02' => '名前', 552 'kana01' => 'みょうじ', 553 'kana02' => 'なまえ', 554 'email' => 'test@example.com', 555 'secret_key' => 'hoge', 556 'point' => '100', 557 'update_date' => '2000-01-01 00:00:00' 558 ), 559 array( 560 'customer_id' => '1002', 561 'name01' => '苗字2', 562 'name02' => '名前2', 563 'kana01' => 'みょうじ2', 564 'kana02' => 'なまえ2', 565 'email' => 'test2@example.com', 566 'secret_key' => 'hoge2', 567 'point' => '200', 568 'update_date' => '2000-01-01 00:00:00' 569 ) 570 ); 571 572 $this->objQuery->delete('dtb_customer'); 573 foreach ($customer as $item) { 574 $this->objQuery->insert('dtb_customer', $item); 575 } 576 } 577 438 578 } 439 579
Note: See TracChangeset
for help on using the changeset viewer.