예제 #1
0
파일: cfg1.php 프로젝트: rzajac/schema
<?php

use Kicaj\Schema\Schema;
use Kicaj\DbKit\DbConnect;
use Kicaj\DbKit\DbConnector;
$config = [Schema::CONFIG_KEY_CONNECTION => DbConnect::getCfg(DbConnector::DB_DRIVER_MYSQL, '127.0.0.1', 'testUser', 'unitTestPass', 'test', '3306'), Schema::CONFIG_KEY_EXPORT_FORMAT => Schema::FORMAT_PHP_ARRAY, Schema::CONFIG_KEY_AINE => true, Schema::CONFIG_KEY_OUTPUT_FILE => 'schema.php'];
return $config;
예제 #2
0
 /**
  * Returns database configuration.
  *
  * @param string $testDbName The name of database connection details form phpunit.xml.
  * @param bool   $connect    Set to true to connect to database right away.
  * @param bool   $debug      Set to true to put database driver in debug mode.
  *
  * @return array
  */
 public static function dbGetConfig($testDbName, $connect = true, $debug = true)
 {
     $timezone = isset($GLOBALS['TEST_DB_' . $testDbName . '_TIMEZONE']) ? $GLOBALS['TEST_DB_' . $testDbName . '_TIMEZONE'] : '';
     return DbConnect::getCfg($GLOBALS['TEST_DB_' . $testDbName . '_DRIVER'], $GLOBALS['TEST_DB_' . $testDbName . '_HOST'], $GLOBALS['TEST_DB_' . $testDbName . '_USERNAME'], $GLOBALS['TEST_DB_' . $testDbName . '_PASSWORD'], $GLOBALS['TEST_DB_' . $testDbName . '_DATABASE'], $GLOBALS['TEST_DB_' . $testDbName . '_PORT'], $connect, $timezone, $debug);
 }
예제 #3
0
 /**
  * @covers ::getDriver
  */
 public function test_getDriver()
 {
     $cfg = DbConnect::getCfg(DbConnector::DB_DRIVER_MYSQL, 'localhost', 'testUser', 'testPass', 'testDb', 1234);
     $this->assertSame(DbConnector::DB_DRIVER_MYSQL, DbConnect::getDriver($cfg));
 }