コード例 #1
0
ファイル: DatabaseSQLTest.php プロジェクト: paladox/mediawiki
 public function testSessionTempTables()
 {
     $temp1 = $this->database->tableName('tmp_table_1');
     $temp2 = $this->database->tableName('tmp_table_2');
     $temp3 = $this->database->tableName('tmp_table_3');
     $this->database->query("CREATE TEMPORARY TABLE {$temp1} LIKE orig_tbl", __METHOD__);
     $this->database->query("CREATE TEMPORARY TABLE {$temp2} LIKE orig_tbl", __METHOD__);
     $this->database->query("CREATE TEMPORARY TABLE {$temp3} LIKE orig_tbl", __METHOD__);
     $this->assertTrue($this->database->tableExists("tmp_table_1", __METHOD__));
     $this->assertTrue($this->database->tableExists("tmp_table_2", __METHOD__));
     $this->assertTrue($this->database->tableExists("tmp_table_3", __METHOD__));
     $this->database->dropTable('tmp_table_1', __METHOD__);
     $this->database->dropTable('tmp_table_2', __METHOD__);
     $this->database->dropTable('tmp_table_3', __METHOD__);
     $this->assertFalse($this->database->tableExists("tmp_table_1", __METHOD__));
     $this->assertFalse($this->database->tableExists("tmp_table_2", __METHOD__));
     $this->assertFalse($this->database->tableExists("tmp_table_3", __METHOD__));
     $this->database->query("CREATE TEMPORARY TABLE tmp_table_1 LIKE orig_tbl", __METHOD__);
     $this->database->query("CREATE TEMPORARY TABLE 'tmp_table_2' LIKE orig_tbl", __METHOD__);
     $this->database->query("CREATE TEMPORARY TABLE `tmp_table_3` LIKE orig_tbl", __METHOD__);
     $this->assertTrue($this->database->tableExists("tmp_table_1", __METHOD__));
     $this->assertTrue($this->database->tableExists("tmp_table_2", __METHOD__));
     $this->assertTrue($this->database->tableExists("tmp_table_3", __METHOD__));
     $this->database->query("DROP TEMPORARY TABLE tmp_table_1 LIKE orig_tbl", __METHOD__);
     $this->database->query("DROP TEMPORARY TABLE 'tmp_table_2' LIKE orig_tbl", __METHOD__);
     $this->database->query("DROP TABLE `tmp_table_3` LIKE orig_tbl", __METHOD__);
     $this->assertFalse($this->database->tableExists("tmp_table_1", __METHOD__));
     $this->assertFalse($this->database->tableExists("tmp_table_2", __METHOD__));
     $this->assertFalse($this->database->tableExists("tmp_table_3", __METHOD__));
 }
コード例 #2
0
 /**
  * @covers DatabaseBase::dropTable
  */
 public function testDropNonExistingTable()
 {
     $this->assertFalse($this->database->dropTable('non_existing', __METHOD__));
 }
コード例 #3
0
 /**
  * @dataProvider provideMakeList
  * @covers DatabaseBase::makeList
  */
 public function testMakeList($list, $mode, $sqlText)
 {
     $this->assertEquals(trim($this->database->makeList($list, $mode)), $sqlText);
 }