Commit d938e6a9 authored by zYne's avatar zYne

--no commit message

--no commit message
parent 8784fe66
......@@ -30,8 +30,10 @@
* @since 1.0
* @version $Revision$
*/
class Doctrine_Export_Sqlite_TestCase extends Doctrine_UnitTestCase {
public function testCreateDatabaseDoesNotExecuteSql() {
class Doctrine_Export_Sqlite_TestCase extends Doctrine_UnitTestCase
{
public function testCreateDatabaseDoesNotExecuteSql()
{
try {
$this->export->createDatabase('db');
$this->fail();
......@@ -39,7 +41,8 @@ class Doctrine_Export_Sqlite_TestCase extends Doctrine_UnitTestCase {
$this->pass();
}
}
public function testDropDatabaseDoesNotExecuteSql() {
public function testDropDatabaseDoesNotExecuteSql()
{
try {
$this->export->dropDatabase('db');
$this->fail();
......@@ -47,16 +50,18 @@ class Doctrine_Export_Sqlite_TestCase extends Doctrine_UnitTestCase {
$this->pass();
}
}
public function testCreateTableSupportsAutoincPks() {
public function testCreateTableSupportsAutoincPks()
{
$name = 'mytable';
$fields = array('id' => array('type' => 'integer', 'unsigned' => 1, 'autoincrement' => true));
$this->export->createTable($name, $fields);
$this->assertEqual($this->adapter->pop(), 'CREATE TABLE mytable (id INTEGER UNSIGNED PRIMARY KEY AUTOINCREMENT)');
$this->assertEqual($this->adapter->pop(), 'CREATE TABLE mytable (id INTEGER PRIMARY KEY AUTOINCREMENT)');
}
public function testCreateTableSupportsDefaultAttribute() {
public function testCreateTableSupportsDefaultAttribute()
{
$name = 'mytable';
$fields = array('name' => array('type' => 'char', 'length' => 10, 'default' => 'def'),
'type' => array('type' => 'integer', 'length' => 3, 'default' => 12)
......@@ -67,7 +72,8 @@ class Doctrine_Export_Sqlite_TestCase extends Doctrine_UnitTestCase {
$this->assertEqual($this->adapter->pop(), 'CREATE TABLE mytable (name CHAR(10) DEFAULT \'def\', type INTEGER DEFAULT 12, PRIMARY KEY(name, type))');
}
public function testCreateTableSupportsMultiplePks() {
public function testCreateTableSupportsMultiplePks()
{
$name = 'mytable';
$fields = array('name' => array('type' => 'char', 'length' => 10),
'type' => array('type' => 'integer', 'length' => 3));
......@@ -89,7 +95,7 @@ class Doctrine_Export_Sqlite_TestCase extends Doctrine_UnitTestCase {
$this->export->createTable('sometable', $fields, $options);
$this->assertEqual($this->adapter->pop(), 'CREATE TABLE sometable (id INTEGER UNSIGNED PRIMARY KEY AUTOINCREMENT, name VARCHAR(4), INDEX myindex (id, name))');
$this->assertEqual($this->adapter->pop(), 'CREATE TABLE sometable (id INTEGER PRIMARY KEY AUTOINCREMENT, name VARCHAR(4), INDEX myindex (id, name))');
}
public function testUnknownIndexSortingAttributeThrowsException()
{
......@@ -120,7 +126,7 @@ class Doctrine_Export_Sqlite_TestCase extends Doctrine_UnitTestCase {
$this->export->createTable('sometable', $fields, $options);
$this->assertEqual($this->adapter->pop(), 'CREATE TABLE sometable (id INTEGER UNSIGNED PRIMARY KEY AUTOINCREMENT, name VARCHAR(4), INDEX myindex (id ASC, name DESC))');
$this->assertEqual($this->adapter->pop(), 'CREATE TABLE sometable (id INTEGER PRIMARY KEY AUTOINCREMENT, name VARCHAR(4), INDEX myindex (id ASC, name DESC))');
}
public function testExportSupportsEmulationOfCascadingDeletes()
{
......
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