Test for getting columns
This commit is contained in:
parent
c9d27916c7
commit
f7dad085d1
@ -214,11 +214,11 @@ $GLOBALS['dummy_queries'] = array(
|
||||
'result' => array(),
|
||||
),
|
||||
array(
|
||||
'query' => 'RENAME TABLE `table1`.`pma_test` TO `table1`.`table3`;',
|
||||
'query' => 'RENAME TABLE `pma_test`.`table1` TO `pma_test`.`table3`;',
|
||||
'result' => array(),
|
||||
),
|
||||
array(
|
||||
'query' => 'SELECT TRIGGER_SCHEMA, TRIGGER_NAME, EVENT_MANIPULATION, EVENT_OBJECT_TABLE, ACTION_TIMING, ACTION_STATEMENT, EVENT_OBJECT_SCHEMA, EVENT_OBJECT_TABLE, DEFINER FROM information_schema.TRIGGERS WHERE TRIGGER_SCHEMA= \'table1\' AND EVENT_OBJECT_TABLE = \'pma_test\';',
|
||||
'query' => 'SELECT TRIGGER_SCHEMA, TRIGGER_NAME, EVENT_MANIPULATION, EVENT_OBJECT_TABLE, ACTION_TIMING, ACTION_STATEMENT, EVENT_OBJECT_SCHEMA, EVENT_OBJECT_TABLE, DEFINER FROM information_schema.TRIGGERS WHERE TRIGGER_SCHEMA= \'pma_test\' AND EVENT_OBJECT_TABLE = \'table1\';',
|
||||
'result' => array(),
|
||||
),
|
||||
|
||||
|
||||
@ -54,7 +54,7 @@ class PMA_Table_Test extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testCreate()
|
||||
{
|
||||
$table = new PMA_Table('pma_test', 'table1');
|
||||
$table = new PMA_Table('table1', 'pma_test');
|
||||
$this->assertInstanceOf('PMA_Table', $table);
|
||||
}
|
||||
|
||||
@ -65,9 +65,23 @@ class PMA_Table_Test extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testRename()
|
||||
{
|
||||
$table = new PMA_Table('pma_test', 'table1');
|
||||
$table = new PMA_Table('table1', 'pma_test');
|
||||
$table->rename('table3');
|
||||
$this->assertEquals('table3', $table->getName());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test getting columns
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testColumns()
|
||||
{
|
||||
$table = new PMA_Table('table1', 'pma_test');
|
||||
$this->assertEquals(
|
||||
array('`pma_test`.`table1`.`i`', '`pma_test`.`table1`.`o`'),
|
||||
$table->getColumns()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user