/** * Tests that the object is initialized with the correct default values. */ public function testConstructorDefaults() { $db = new MockSqlite3(array('autoConnect' => false)); $result = $db->get('_config'); $expected = array('autoConnect' => false, 'database' => ':memory:', 'encoding' => null, 'persistent' => true, 'host' => 'localhost', 'login' => 'root', 'password' => '', 'dsn' => null, 'options' => array(), 'init' => true); $this->assertEqual($expected, $result); }
/** * Tests that the object is initialized with the correct default values. * * @return void */ public function testConstructorDefaults() { $db = new MockSqlite3(array('autoConnect' => false)); $result = $db->get('_config'); $expected = array('autoConnect' => false, 'database' => '', 'flags' => NULL, 'key' => NULL, 'persistent' => true, 'host' => 'localhost', 'login' => 'root', 'password' => '', 'init' => true); $this->assertEqual($expected, $result); }
public function testNameQuoting() { $db = new MockSqlite3(array('autoConnect' => false)); $result = $db->name('title'); $expected = '"title"'; $this->assertEqual($expected, $result); }