Commit 2f4801fe authored by zYne's avatar zYne

added tests for sqlite import driver

parent b3e59ab7
......@@ -30,5 +30,32 @@
* @since 1.0
* @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->expr = $this->connection->expression;
$this->sequence = $this->connection->sequence;
$this->import = $this->connection->import;
}
$this->unitOfWork = $this->connection->unitOfWork;
$this->connection->setListener(new Doctrine_EventListener());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment