From 5006400cf9f3a86fc1482005feb63e26b0484118 Mon Sep 17 00:00:00 2001 From: zYne Date: Thu, 14 Jun 2007 20:42:05 +0000 Subject: [PATCH] --- tests/Export/MysqlTestCase.php | 9 ++++----- tests/Export/PgsqlTestCase.php | 3 ++- tests/Export/_files/FooRecord.php | 8 ++++++-- tests/run.php | 5 ++++- 4 files changed, 16 insertions(+), 9 deletions(-) diff --git a/tests/Export/MysqlTestCase.php b/tests/Export/MysqlTestCase.php index bbbb50991..4f95bd223 100644 --- a/tests/Export/MysqlTestCase.php +++ b/tests/Export/MysqlTestCase.php @@ -300,15 +300,14 @@ class ForeignKeyTest extends Doctrine_Record $this->hasColumn('parent_id', 'integer'); $this->hasOne('ForeignKeyTest as Parent', - 'ForeignKeyTest.parent_id' - ); - - $this->hasMany('ForeignKeyTest as Children', - 'ForeignKeyTest.parent_id', + 'ForeignKeyTest.parent_id', array('onDelete' => 'CASCADE', 'onUpdate' => 'RESTRICT') ); + $this->hasMany('ForeignKeyTest as Children', + 'ForeignKeyTest.parent_id'); + $this->option('type', 'INNODB'); } diff --git a/tests/Export/PgsqlTestCase.php b/tests/Export/PgsqlTestCase.php index e030f1426..2c6df1bdf 100644 --- a/tests/Export/PgsqlTestCase.php +++ b/tests/Export/PgsqlTestCase.php @@ -77,9 +77,10 @@ class Doctrine_Export_Pgsql_TestCase extends Doctrine_UnitTestCase $this->assertEqual($this->adapter->pop(), 'CREATE TABLE mytable (name CHAR(10), type INT, PRIMARY KEY(name, type))'); } - public function testExportSql() + public function testExportSql() { $sql = $this->export->exportSql(dirname(__FILE__) . DIRECTORY_SEPARATOR . '_files'); + $this->assertEqual($sql, array ( 0 => 'CREATE TABLE foo (id BIGSERIAL, name VARCHAR(200) NOT NULL, parent_id BIGINT, local_foo BIGINT, PRIMARY KEY(id))', 1 => 'CREATE TABLE foo_reference (foo1 BIGINT, foo2 BIGINT, PRIMARY KEY(foo1, foo2))', 2 => 'CREATE TABLE foo_bar_record (fooid BIGINT, barid BIGINT, PRIMARY KEY(fooid, barid))', diff --git a/tests/Export/_files/FooRecord.php b/tests/Export/_files/FooRecord.php index 0850c69b6..1709ef4bd 100644 --- a/tests/Export/_files/FooRecord.php +++ b/tests/Export/_files/FooRecord.php @@ -20,7 +20,7 @@ class FooRecord extends Doctrine_Record $this->hasMany('FooRecord as FooParents', array('local' => 'foo1', 'foreign' => 'foo2', 'refClass' => 'FooReferenceRecord', - 'onDelete' => 'CASCADE', + 'onDelete' => 'RESTRICT', )); $this->hasMany('FooRecord as FooChildren', array('local' => 'foo2', @@ -33,7 +33,11 @@ class FooRecord extends Doctrine_Record $this->hasOne('FooRecord as Parent', array('local' => 'parent_id', 'foreign' => 'id', 'onDelete' => 'CASCADE')); $this->hasOne('FooForeignlyOwnedWithPk', array('local' => 'id', 'foreign' => 'id', 'constraint' => true)); $this->hasOne('FooLocallyOwned', array('local' => 'local_foo', 'onDelete' => 'RESTRICT')); - $this->hasMany('BarRecord as Bar', array('local' => 'fooId', 'foreign' => 'barId', 'refClass' => 'FooBarRecord')); + + $this->hasMany('BarRecord as Bar', array('local' => 'fooId', + 'foreign' => 'barId', + 'refClass' => 'FooBarRecord', + 'onUpdate' => 'RESTRICT')); } } diff --git a/tests/run.php b/tests/run.php index 5eef8514a..4859c351b 100644 --- a/tests/run.php +++ b/tests/run.php @@ -68,6 +68,7 @@ $test = new GroupTest('Doctrine Framework Unit Tests'); /** */ // Temp tests + $test->addTestCase(new Doctrine_Ticket330_TestCase()); // Connection drivers (not yet fully tested) @@ -122,7 +123,7 @@ $test->addTestCase(new Doctrine_Export_Oracle_TestCase()); $test->addTestCase(new Doctrine_Export_Sqlite_TestCase()); $test->addTestCase(new Doctrine_Export_Mysql_TestCase()); -$test->addTestCase(new Doctrine_CascadingDelete_TestCase()); +//$test->addTestCase(new Doctrine_CascadingDelete_TestCase()); // Import module (not yet fully tested) //$test->addTestCase(new Doctrine_Import_TestCase()); @@ -175,6 +176,7 @@ $test->addTestCase(new Doctrine_Relation_Parser_TestCase()); // Datatypes $test->addTestCase(new Doctrine_Enum_TestCase()); + $test->addTestCase(new Doctrine_Boolean_TestCase()); @@ -290,6 +292,7 @@ $test->addTestCase(new Doctrine_Query_JoinCondition_TestCase()); $test->addTestCase(new Doctrine_Query_MultipleAggregateValue_TestCase()); +$test->addTestCase(new Doctrine_IntegrityAction_TestCase()); // Cache tests //$test->addTestCase(new Doctrine_Cache_Query_SqliteTestCase()); //$test->addTestCase(new Doctrine_Cache_FileTestCase());