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

Revision 22857, 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 * SC_Helper_Maker::getList()のテストクラス.
29 *
30 * @author hiroshi kakuta
31 */
32class SC_Helper_Maker_getListTest extends SC_Helper_Maker_TestBase
33{
34
35    var $objHelperMaker;
36
37    protected function setUp()
38    {
39        parent::setUp();
40        $this->objHelperMaker = new SC_Helper_Maker_Ex();
41        $this->setUpMaker();
42    }
43
44    protected function tearDown()
45    {
46        parent::tearDown();
47    }
48
49    /** rankが存在しない場合、空を返す。
50     */
51    public function testGetList_存在しない場合空を返す()
52    {
53
54        $this->deleteAllMaker();
55
56        $this->expected = array();
57        $this->actual = $this->objHelperMaker->getList();
58
59        $this->verify();
60    }
61
62    public function testGetList_データがある場合_想定した結果が返る(){
63
64        $this->expected = array(
65            array(
66                'maker_id' => '1004',
67                'name' => 'MEC'
68            ),
69            array(
70                'maker_id' => '1003',
71                'name' => 'シャンプー'
72            ),
73            array(
74                'maker_id' => '1001',
75                'name' => 'ソニン'
76            )
77        );
78
79        $this->actual = $this->objHelperMaker->getList();
80        $this->verify();
81    }
82
83    public function testGetList_一覧取得has_deleteをtrueにした場合削除済みデータも取得(){
84
85        $this->expected = array(
86            array(
87                'maker_id' => '1004',
88                'name' => 'MEC'
89            ),
90            array(
91                'maker_id' => '1003',
92                'name' => 'シャンプー'
93            ),
94            array(
95                'maker_id' => '1002',
96                'name' => 'パソナニック'
97            ),
98            array(
99                'maker_id' => '1001',
100                'name' => 'ソニン'
101            )
102        );
103
104        $this->actual = $this->objHelperMaker->getList(true);
105        $this->verify();
106    }
107}
108
Note: See TracBrowser for help on using the repository browser.