| 1 | <?php |
---|
| 2 | /* |
---|
| 3 | * This file is part of EC-CUBE |
---|
| 4 | * |
---|
| 5 | * Copyright(c) 2000-2010 LOCKON CO.,LTD. All Rights Reserved. |
---|
| 6 | * |
---|
| 7 | * http://www.lockon.co.jp/ |
---|
| 8 | * |
---|
| 9 | * This program is free software; you can redistribute it and/or |
---|
| 10 | * modify it under the terms of the GNU General Public License |
---|
| 11 | * as published by the Free Software Foundation; either version 2 |
---|
| 12 | * of the License, or (at your option) any later version. |
---|
| 13 | * |
---|
| 14 | * This program is distributed in the hope that it will be useful, |
---|
| 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
| 17 | * GNU General Public License for more details. |
---|
| 18 | * |
---|
| 19 | * You should have received a copy of the GNU General Public License |
---|
| 20 | * along with this program; if not, write to the Free Software |
---|
| 21 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
---|
| 22 | */ |
---|
| 23 | |
---|
| 24 | // {{{ requires |
---|
| 25 | require_once(realpath(dirname(__FILE__)) . "/../../require.php"); |
---|
| 26 | require_once(realpath(dirname(__FILE__)) . "/../../../data/class_extends/db_extends/SC_DB_DBFactory_Ex.php"); |
---|
| 27 | |
---|
| 28 | /** |
---|
| 29 | * SC_DB_DBFactory TestCase |
---|
| 30 | * |
---|
| 31 | * @package DB |
---|
| 32 | * @author LOCKON CO.,LTD. |
---|
| 33 | * @version $Id:SC_DB_DBFactory_Test.php 15532 2007-08-31 14:39:46Z nanasess $ |
---|
| 34 | */ |
---|
| 35 | class SC_DB_DBFactory_Test extends PHPUnit_Framework_TestCase { |
---|
| 36 | |
---|
| 37 | // }}} |
---|
| 38 | // {{{ functions |
---|
| 39 | |
---|
| 40 | /* TODO |
---|
| 41 | function testSfGetDBVersion() { |
---|
| 42 | $dbFactory = SC_DB_DBFactory::getInstance(); |
---|
| 43 | $objQuery = new SC_Query(DEFAULT_DSN, true, true); |
---|
| 44 | switch (DB_TYPE) { |
---|
| 45 | case "pgsql": |
---|
| 46 | $this->assertEquals(true, preg_match("/^PostgreSQL [78].[0-9].[0-9]{1,}$/", $dbFactory->sfGetDBVersion())); |
---|
| 47 | break; |
---|
| 48 | |
---|
| 49 | case "mysql": |
---|
| 50 | $this->assertEquals(true, preg_match("/^MySQL [78].[0-9].[0-9]{1,}$/", $dbFactory->sfGetDBVersion())); |
---|
| 51 | break; |
---|
| 52 | default: |
---|
| 53 | } |
---|
| 54 | } |
---|
| 55 | */ |
---|
| 56 | |
---|
| 57 | function testFindTableNames() { |
---|
| 58 | $dbFactory = SC_DB_DBFactory::getInstance(); |
---|
| 59 | $objQuery = new SC_Query(DEFAULT_DSN, true, true); |
---|
| 60 | $actual = $dbFactory->findTableNames("mtb_pre"); |
---|
| 61 | $this->assertEquals("mtb_pref", $actual[0]); |
---|
| 62 | } |
---|
| 63 | } |
---|
| 64 | |
---|
| 65 | /* |
---|
| 66 | * Local variables: |
---|
| 67 | * coding: utf-8 |
---|
| 68 | * End: |
---|
| 69 | */ |
---|
| 70 | ?> |
---|