source: branches/camp/camp-2_13-tests/tests/class/helper/SC_Helper_DB/SC_Helper_DB_TestBase.php @ 22678

Revision 22678, 5.0 KB checked in by poego, 9 years ago (diff)

#2185 SC_Helper_DBが10%くらいできたのでコミット。一部リファクタ

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_Purchaseのテストの基底クラス.
28 *
29 *
30 * @author Hiroko Tamagawa
31 * @version $Id$
32 */
33class SC_Helper_DB_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 setUpNews()
50    {
51        $news = array(
52            array(
53            'update_date' => '2000-01-01 00:00:00',
54            'news_id' => '1',
55            'news_title' => 'ニュース情報01',
56            'rank' => '1',
57            'creator_id' => '1',
58            'del_flg' => '0'
59            ),
60            array(
61            'update_date' => '2000-01-01 00:00:00',
62            'news_id' => '2',
63            'news_title' => 'ニュース情報02',
64            'rank' => '2',
65            'creator_id' => '1',
66            'del_flg' => '0'
67            ),
68            array(
69            'update_date' => '2000-01-01 00:00:00',
70            'news_id' => '3',
71            'news_title' => 'ニュース情報03',
72            'rank' => '3',
73            'creator_id' => '1',
74            'del_flg' => '0'
75            )
76        );
77
78        $this->objQuery->delete('dtb_news');
79        foreach ($news as $key => $item) {
80            $this->objQuery->insert('dtb_news', $item);
81        }
82    }
83 
84    /**
85    * DBに基本情報を設定します。
86    */
87    protected function setUpBasisData()
88    {
89        $baseInfo = array(
90            'id' => '1',
91            'company_name' => 'testshop',
92            'company_kana' => 'テストショップ',
93            'zip01' => '530',
94            'zip02' => '0001',
95            'pref' => '1',
96            'addr01' => 'testaddr01',
97            'addr02' => 'testaddr02',
98            'tel01' => '11',
99            'tel02' => '2222',
100            'tel03' => '3333',
101            'fax01' => '11',
102            'fax02' => '2222',
103            'fax03' => '3333',
104            'business_hour' => '09-18',
105            'law_company' => 'lawcampanyname',
106            'law_manager' => 'lawmanager',
107            'law_zip01' => '530',
108            'law_zip02' => '0001',
109            'law_pref' => '1',
110            'law_addr01' => 'lawaddr01',
111            'law_addr02' => 'lawaddr02',
112            'law_tel01' => '11',
113            'law_tel02' => '2222',
114            'law_tel03' => '3333',
115            'law_fax01' => '11',
116            'law_fax02' => '2222',
117            'law_fax03' => '3333',
118            'law_email' => 'test@test.com',
119            'law_url' => 'http://test.test',
120            'law_term01' => 'lawterm01',
121            'law_term02' => 'lawterm02',
122            'law_term03' => 'lawterm03',
123            'law_term04' => 'lawterm04',
124            'law_term05' => 'lawterm05',
125            'law_term06' => 'lawterm06',
126            'law_term07' => 'lawterm07',
127            'law_term08' => 'lawterm08',
128            'law_term09' => 'lawterm09',
129            'law_term10' => 'lawterm10',
130            'tax' => '5',
131            'tax_rule' => '1',
132            'email01' => 'test1@test.com',
133            'email02' => 'test2@test.com',
134            'email03' => 'test3@test.com',
135            'email04' => 'test4@test.com',
136            'email05' => 'test5@test.com',
137            'free_rule' => '1000',
138            'shop_name' => 'shopname',
139            'shop_kana' => 'ショップネーム',
140            'shop_name_eng' => 'shopnameeng',
141            'point_rate' => '10',
142            'welcome_point' => '100',
143            'update_date' => '2012-02-14 11:22:33',
144            'top_tpl' => 'top.tpl',
145            'product_tpl' => 'product.tpl',
146            'detail_tpl' => 'detail.tpl',
147            'mypage_tpl' => 'mypage.tpl',
148            'good_traded' => 'goodtraded',
149            'message' => 'message',
150            'regular_holiday_ids' => '0|6',
151            'latitude' => '30.0001',
152            'longitude' => '45.0001',
153            'downloadable_days' => '10',
154            'downloadable_days_unlimited' => '0'
155        );
156
157        $this->objQuery->delete('dtb_baseinfo');
158        $this->objQuery->insert('dtb_baseinfo', $baseInfo);
159    }   
160
161   
162}
Note: See TracBrowser for help on using the repository browser.