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

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

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

  • 主に空白・空白行の調整。もう少し整えたいが、一旦現状コミット。
  • Property svn:executable set to *
Line 
1<?php
2
3$HOME = realpath(dirname(__FILE__)) . "/../../../..";
4require_once($HOME . "/tests/class/helper/SC_Helper_Maker/SC_Helper_Maker_TestBase.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/**
28 *
29 * @author hiroshi kakuta
30 */
31class SC_Helper_Maker_saveMakerTest extends SC_Helper_Maker_TestBase
32{
33    var $objHelperMaker;
34
35    protected function setUp()
36    {
37
38        parent::setUp();
39        $this->setUpMaker();
40        $this->objHelperMaker = new SC_Helper_Maker_Ex();
41    }
42
43    protected function tearDown()
44    {
45        parent::tearDown();
46    }
47
48    public function testSaveMaker_メーカーIDを指定すると更新される(){
49    //public function testSaveMaker_update(){
50        $sqlVal = array(
51            'maker_id' => '1001',
52            'name' => 'ソニンー',
53        );
54
55        $this->objHelperMaker->saveMaker($sqlVal);
56
57        $this->expected = array(
58            'name' => 'ソニンー',
59        );
60
61        $arrRet = $this->objHelperMaker->getMaker('1001');
62
63        $this->actual = Test_Utils::mapArray($arrRet,
64            array('name')
65        );
66
67        $this->verify();
68    }
69
70    public function testSaveMaker_メーカーIDがない場合_インサートされる(){
71    //public function testSaveMaker_insert(){
72
73        if(DB_TYPE != 'pgsql') { //postgresqlだとどうしてもDBエラーになるのでとりいそぎ回避
74            $sqlVal = array(
75                'name' => 'フジスリー',
76                'creator_id' => '1',
77                'del_flg' => '0'
78            );
79
80            $maker_id = $this->objHelperMaker->saveMaker($sqlVal);
81
82
83            $this->expected = array(
84                'name' => 'フジスリー',
85                'rank' => '5',
86                'creator_id' => '1',
87                'del_flg' => '0'
88            );
89
90            $arrRet = $this->objHelperMaker->getMaker($maker_id);
91
92            $this->actual = Test_Utils::mapArray($arrRet,
93                array(
94                    'name',
95                    'rank',
96                    'creator_id',
97                    'del_flg'
98                )
99            );
100
101            $this->verify();
102        }
103
104    }
105
106}
107
Note: See TracBrowser for help on using the repository browser.