source: branches/camp/camp-2_13-tests/tests/class/helper/SC_Helper_BestProducts/SC_Helper_BestProducts_TestBase.php @ 22656

Revision 22656, 3.1 KB checked in by hiro151, 11 years ago (diff)

#2183 SC_Helper_BestProductsクラスのテストコード(途中)

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    /**
48     * DBにお勧め情報を登録します.
49     */
50    protected function setUpBestProducts()
51    {
52        $products = array(
53            array(
54                'best_id' => '1001',
55                'product_id'=>'2',
56                'category_id' => '0',
57                'rank' => '1',
58                'title' => 'タイトルですよ',
59                'comment' => 'コメントですよ',
60                'creator_id' => '1',
61                'create_date' => '2000-01-01 00:00:00',
62                'update_date' => '2000-01-01 00:00:00',
63                'del_flg' => '0'
64            ),
65            array(
66                'best_id' => '1002',
67                'product_id'=>'1',
68                'category_id' => '0',
69                'rank' => '2',
70                'title' => 'タイトルですよ',
71                'comment' => 'コメントですよ',
72                'creator_id' => '1',
73                'create_date' => '2000-01-01 00:00:00',
74                'update_date' => '2000-01-01 00:00:00',
75                'del_flg' => '1'
76            ),
77            array(
78                'best_id' => '1003',
79                'product_id'=>'3',
80                'category_id' => '1',
81                'rank' => '3',
82                'title' => 'タイトルですよ3',
83                'comment' => 'コメントですよ3',
84                'creator_id' => '3',
85                'create_date' => '2000-01-01 00:00:00',
86                'update_date' => '2000-01-01 00:00:00',
87                'del_flg' => '0'
88            )
89        );
90
91        $this->objQuery->delete('dtb_best_products');
92        foreach ($products as  $item) {
93            $this->objQuery->insert('dtb_best_products', $item);
94        }
95    }
96
97    //dtb_best_productsを全て削除する
98    protected function deleteAllBestProducts(){
99        $this->objQuery->delete('dtb_best_products');
100    }
101}
102
Note: See TracBrowser for help on using the repository browser.