Inheritance: extends lithium\data\source\database\adapter\MySql
コード例 #1
0
 /**
  * Tests that the object is initialized with the correct default values.
  */
 public function testConstructorDefaults()
 {
     $db = new MockMySql(array('autoConnect' => false));
     $result = $db->get('_config');
     $expected = array('autoConnect' => false, 'encoding' => null, 'persistent' => true, 'host' => 'localhost:3306', 'login' => 'root', 'password' => '', 'database' => null, 'dsn' => null, 'options' => array(), 'init' => true);
     $this->assertEqual($expected, $result);
 }
コード例 #2
0
ファイル: MySqlTest.php プロジェクト: unionofrad/lithium
 public function testDsnSocket()
 {
     $db = new MockMySql(array('autoConnect' => false, 'host' => '/tmp/foo/bar.socket', 'database' => 'test') + $this->_dbConfig);
     $expected = 'mysql:unix_socket=/tmp/foo/bar.socket;dbname=test';
     $result = $db->dsn();
     $this->assertEqual($expected, $result);
 }