diff --git a/tests/unit/e_db_pdoTest.php b/tests/unit/e_db_pdoTest.php index 89f9ec977..4c4cc08d3 100644 --- a/tests/unit/e_db_pdoTest.php +++ b/tests/unit/e_db_pdoTest.php @@ -150,6 +150,26 @@ } + public function testDb_IsLang() + { + $result = $this->db->db_IsLang('news', false); + $this->assertEquals('news', $result); + + $this->db->copyTable('news','lan_spanish_news',true, true); + + e107::getConfig()->set('multilanguage',true)->save(); + + $this->db->setLanguage('Spanish'); + + $result = $this->db->db_IsLang('news', false); + $this->assertEquals('lan_spanish_news', $result); + + $this->db->setLanguage('English'); + + $this->db->dropTable('lan_spanish_news'); + } + + public function testDb_Write_log() { @@ -416,6 +436,14 @@ } + public function testGetLastQuery() + { + $this->db->select('user'); + $result = $this->db->getLastQuery(); + $this->assertEquals("SELECT * FROM e107_user", $result); + } + + public function testDb_UpdateArray() { @@ -719,8 +747,6 @@ $list = $this->db->db_TableList('lan'); $this->assertEmpty($list); - //var_dump($list); - } public function testTables() @@ -819,6 +845,27 @@ public function testGetFieldDefs() { + $actual = $this->db->getFieldDefs('plugin'); + + $expected = array ( + '_FIELD_TYPES' => + array ( + 'plugin_id' => 'int', + 'plugin_name' => 'escape', + 'plugin_version' => 'escape', + 'plugin_path' => 'escape', + 'plugin_installflag' => 'int', + 'plugin_addons' => 'escape', + 'plugin_category' => 'escape', + ), + '_NOTNULL' => + array ( + 'plugin_id' => '', + 'plugin_addons' => '', + ), + ); + + $this->assertEquals($expected, $actual); }