source: branches/feature-module-update/test/class/db/SC_DB_DBFactory_Test.php @ 15692

Revision 15692, 1.4 KB checked in by nanasess, 17 years ago (diff)

テーブル一覧を配列で返す関数を追加

  • Property svn:keywords set to Id Revision Date
  • Property svn:mime-type set to text/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($include_dir . "/../data/class/db_extends/SC_DB_DBFactory_Ex.php"); // FIXME
10require_once("PHPUnit/TestCase.php");
11
12/**
13 * SC_DB_DBFactory TestCase
14 *
15 * @package DB
16 * @author LOCKON CO.,LTD.
17 * @version $Id:SC_DB_DBFactory_Test.php 15532 2007-08-31 14:39:46Z nanasess $
18 */
19class SC_DB_DBFactory_Test extends PHPUnit_TestCase {
20
21    // }}}
22    // {{{ functions
23
24    /* TODO
25    function testSfGetDBVersion() {
26        $dbFactory = SC_DB_DBFactory::getInstance();
27        $objQuery = new SC_Query(DEFAULT_DSN, true, true);
28        switch (DB_TYPE) {
29            case "pgsql":
30                $this->assertEquals(true, preg_match("/^PostgreSQL [78].[0-9].[0-9]{1,}$/", $dbFactory->sfGetDBVersion()));
31            break;
32
33            case "mysql":
34                $this->assertEquals(true, preg_match("/^MySQL [78].[0-9].[0-9]{1,}$/", $dbFactory->sfGetDBVersion()));
35            break;
36            default:
37        }
38    }
39    */
40
41    function testFindTableNames() {
42        $dbFactory = SC_DB_DBFactory::getInstance();
43        $objQuery = new SC_Query(DEFAULT_DSN, true, true);
44        $actual = $dbFactory->findTableNames("mtb_pre");
45        $this->assertEquals("mtb_pref", $actual[0]);
46    }
47}
48
49/*
50 * Local variables:
51 * coding: utf-8
52 * End:
53 */
54?>
Note: See TracBrowser for help on using the repository browser.