source: branches/camp/camp-2_13-tests/tests/class/helper/SC_Helper_Maker/SC_Helper_Maker_getListTest.php @ 22727

Revision 22727, 2.9 KB checked in by hiro151, 11 years ago (diff)

#2186 テストコード 途中

  • 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    }
45
46    protected function tearDown()
47    {
48        parent::tearDown();
49    }
50
51    /** rankが存在しない場合、空を返す。
52     */
53    public function testGetList_存在しない場合空を返す()
54    {
55
56        $this->deleteAllMaker();
57
58        $this->expected = array();
59        $this->actual = $this->objHelperMaker->getList();
60
61        $this->verify();
62    }
63
64    public function testGetList_データがある場合_想定した結果が返る(){
65
66        $this->expected = array(
67            array(
68                'maker_id' => '1004',
69                'name' => 'MEC'
70            ),
71            array(
72                'maker_id' => '1003',
73                'name' => 'シャンプー'
74            ),
75            array(
76                'maker_id' => '1001',
77                'name' => 'ソニン'
78            )
79        );
80
81        $this->actual = $this->objHelperMaker->getList();
82        $this->verify();
83
84    }
85
86    public function testGetList_一覧取得has_deleteをtrueにした場合削除済みデータも取得(){
87
88        $this->expected = array(
89            array(
90                'maker_id' => '1004',
91                'name' => 'MEC'
92            ),
93            array(
94                'maker_id' => '1003',
95                'name' => 'シャンプー'
96            ),
97            array(
98                'maker_id' => '1002',
99                'name' => 'パソナニック'
100            ),
101            array(
102                'maker_id' => '1001',
103                'name' => 'ソニン'
104            )
105        );
106
107        $this->actual = $this->objHelperMaker->getList(true);
108        $this->verify();
109
110    }
111
112}
113
Note: See TracBrowser for help on using the repository browser.