source: branches/version-2_13-dev/tests/class/helper/SC_Helper_BestProducts/SC_Helper_BestProducts_TestBase.php @ 22856

Revision 22856, 3.1 KB checked in by Seasoft, 11 years ago (diff)

#2043 (typo修正・ソース整形・ソースコメントの改善 for 2.13.0)

  • 主に空白・空白行の調整。もう少し整えたいが、一旦現状コミット。
Line 
1<?php
2
3$HOME = realpath(dirname(__FILE__)) . "/../../../..";
4require_once($HOME . "/tests/class/Common_TestCase.php");
5/*
6 * This file is part of EC-CUBE
7 *
8 * Copyright(c) 2000-2013 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 */
26/**
27 * SC_Helper_BestProductsのテストの基底クラス.
28 *
29 *
30 * @author hiroshi kakuta
31 * @version $Id$
32 */
33class SC_Helper_BestProducts_TestBase extends Common_TestCase
34{
35
36    protected function setUp()
37    {
38        parent::setUp();
39    }
40
41    protected function tearDown()
42    {
43        parent::tearDown();
44    }
45
46    /**
47     * DBにお勧め情報を登録します.
48     */
49    protected function setUpBestProducts()
50    {
51        $products = array(
52            array(
53                'best_id' => '1001',
54                'product_id'=>'2',
55                'category_id' => '0',
56                'rank' => '1',
57                'title' => 'タイトルですよ',
58                'comment' => 'コメントですよ',
59                'creator_id' => '1',
60                'create_date' => '2000-01-01 00:00:00',
61                'update_date' => '2000-01-01 00:00:00',
62                'del_flg' => '0'
63            ),
64            array(
65                'best_id' => '1002',
66                'product_id'=>'1',
67                'category_id' => '0',
68                'rank' => '2',
69                'title' => 'タイトルですよ',
70                'comment' => 'コメントですよ',
71                'creator_id' => '1',
72                'create_date' => '2000-01-01 00:00:00',
73                'update_date' => '2000-01-01 00:00:00',
74                'del_flg' => '1'
75            ),
76            array(
77                'best_id' => '1003',
78                'product_id'=>'3',
79                'category_id' => '1',
80                'rank' => '3',
81                'title' => 'タイトルですよ3',
82                'comment' => 'コメントですよ3',
83                'creator_id' => '3',
84                'create_date' => '2000-01-01 00:00:00',
85                'update_date' => '2000-01-01 00:00:00',
86                'del_flg' => '0'
87            )
88        );
89
90        $this->objQuery->delete('dtb_best_products');
91        foreach ($products as  $item) {
92            $this->objQuery->insert('dtb_best_products', $item);
93        }
94    }
95
96    //dtb_best_productsを全て削除する
97    protected function deleteAllBestProducts(){
98        $this->objQuery->delete('dtb_best_products');
99    }
100}
101
Note: See TracBrowser for help on using the repository browser.