source: branches/feature-module-update/test/class/db/SC_DB_MasterData_Test.php @ 15135

Revision 15135, 1.1 KB checked in by nanasess, 15 years ago (diff)

未実装だった関数を実装

  • Property charset set to UTF-8
  • Property svn:keywords set to Id Revision Date
  • Property svn:mime-type set to application/x-httpd-php;charset=utf-8
Line 
1<?php
2/*
3 * Copyright(c) 2000-2007 LOCKON CO.,LTD. All Rights Reserved.
4 *
5 * http://www.lockon.co.jp/
6 */
7
8// {{{ requires
9require_once(CLASS_PATH . "db_extends/SC_DB_MasterData_Ex.php");
10require_once("PHPUnit/TestCase.php");
11
12/**
13 * SC_DB_MasterData のテストケース.
14 *
15 * @package DB
16 * @author LOCKON CO.,LTD.
17 * @version $Id$
18 */
19class SC_DB_MasterData_Test extends PHPUnit_TestCase {
20
21    // }}}
22    // {{{ functions
23
24    /**
25     * SC_DB_MasterData::getMasterData() のテストケース
26     */
27    function testGetMasterData() {
28
29        $columns = array("pref_id", "pref_name", "rank");
30        $masterData = new SC_DB_MasterData_Ex();
31        $actual = $masterData->getMasterData("mtb_pref", $columns);
32
33        $objQuery = new SC_Query();
34        $objQuery->setorder($columns[2]);
35        $results = $objQuery->select($columns[0] . ", " . $columns[1], "mtb_pref");
36
37        $expected = array();
38        foreach ($results as $result) {
39
40            $expected[$result[$columns[0]]] = $result[$columns[1]];
41        }
42        $this->assertEquals($expected, $actual);
43    }
44}
45?>
Note: See TracBrowser for help on using the repository browser.