1
0
mirror of synced 2024-12-13 14:56:01 +03:00

added tests for sqlite import driver

This commit is contained in:
zYne 2007-01-14 22:44:23 +00:00
parent b3e59ab76d
commit 2f4801fe27
2 changed files with 29 additions and 1 deletions

View File

@ -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);
}
}

View File

@ -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());