added tests for sqlite import driver
This commit is contained in:
parent
b3e59ab76d
commit
2f4801fe27
@ -30,5 +30,32 @@
|
|||||||
* @since 1.0
|
* @since 1.0
|
||||||
* @version $Revision$
|
* @version $Revision$
|
||||||
*/
|
*/
|
||||||
class Doctrine_Import_Sqlite_TestCase extends Doctrine_UnitTestCase {
|
class Doctrine_Import_Sqlite_TestCase extends Doctrine_UnitTestCase
|
||||||
|
{
|
||||||
|
public function testListSequencesExecutesSql()
|
||||||
|
{
|
||||||
|
$this->import->listSequences('table');
|
||||||
|
|
||||||
|
$this->assertEqual($this->adapter->pop(), "SELECT name FROM sqlite_master WHERE type='table' AND sql NOT NULL ORDER BY name");
|
||||||
|
}
|
||||||
|
public function testListTableColumnsExecutesSql()
|
||||||
|
{
|
||||||
|
$this->import->listTableColumns('table');
|
||||||
|
|
||||||
|
$this->assertEqual($this->adapter->pop(), "PRAGMA table_info(table)");
|
||||||
|
}
|
||||||
|
public function testListTableIndexesExecutesSql()
|
||||||
|
{
|
||||||
|
$this->import->listTableIndexes('table');
|
||||||
|
|
||||||
|
$this->assertEqual($this->adapter->pop(), "PRAGMA index_list(table)");
|
||||||
|
}
|
||||||
|
public function testListTablesExecutesSql()
|
||||||
|
{
|
||||||
|
$this->import->listTables();
|
||||||
|
|
||||||
|
$q = "SELECT name FROM sqlite_master WHERE type = 'table' UNION ALL SELECT name FROM sqlite_temp_master WHERE type = 'table' ORDER BY name";
|
||||||
|
|
||||||
|
$this->assertEqual($this->adapter->pop(), $q);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -115,6 +115,7 @@ class Doctrine_UnitTestCase extends UnitTestCase {
|
|||||||
$this->dataDict = $this->connection->dataDict;
|
$this->dataDict = $this->connection->dataDict;
|
||||||
$this->expr = $this->connection->expression;
|
$this->expr = $this->connection->expression;
|
||||||
$this->sequence = $this->connection->sequence;
|
$this->sequence = $this->connection->sequence;
|
||||||
|
$this->import = $this->connection->import;
|
||||||
}
|
}
|
||||||
$this->unitOfWork = $this->connection->unitOfWork;
|
$this->unitOfWork = $this->connection->unitOfWork;
|
||||||
$this->connection->setListener(new Doctrine_EventListener());
|
$this->connection->setListener(new Doctrine_EventListener());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user