diff --git a/tests/ConnectionTestCase.php b/tests/ConnectionTestCase.php index 40b1217c6..6a31f244f 100644 --- a/tests/ConnectionTestCase.php +++ b/tests/ConnectionTestCase.php @@ -130,7 +130,7 @@ class Doctrine_Connection_TestCase extends Doctrine_UnitTestCase { $this->conn->exec('DROP TABLE entity'); } public function testGetManager() { - $this->assertEqual($this->connection->getManager(),$this->manager); + $this->assertTrue($this->connection->getManager() === $this->manager); } public function testDelete() { $user = $this->connection->create('User'); diff --git a/tests/Export/MysqlTestCase.php b/tests/Export/MysqlTestCase.php index 3e79532de..d346d2630 100644 --- a/tests/Export/MysqlTestCase.php +++ b/tests/Export/MysqlTestCase.php @@ -259,6 +259,31 @@ class Doctrine_Export_Mysql_TestCase extends Doctrine_UnitTestCase $this->assertEqual($this->adapter->pop(), 'CREATE TABLE mysql_index_test_record (id BIGINT AUTO_INCREMENT, name TEXT, code INT, content TEXT, FULLTEXT INDEX content_idx (content), UNIQUE INDEX namecode_idx (name, code), PRIMARY KEY(id)) ENGINE = MYISAM'); } + public function testExportSupportsForeignKeys() + { + $r = new MysqlForeignKeyTest; + //print $this->adapter->pop(); + //$this->assertEqual($this->adapter->pop()); + } +} +class MysqlForeignKeyTest extends Doctrine_Record +{ + public function setTableDefinition() + { + $this->hasColumn('name', 'string', null); + $this->hasColumn('code', 'integer', 4); + $this->hasColumn('content', 'string', 4000); + $this->hasColumn('parent_id', 'integer'); + + $this->foreignKey(array('local' => 'id', + 'foreign' => 'parent_id', + 'foreignTable' => 'mysql_foreign_key_test', + 'onDelete' => 'CASCADE') + ); + + $this->option('type', 'INNODB'); + + } } class MysqlIndexTestRecord extends Doctrine_Record { @@ -283,7 +308,7 @@ class MysqlTestRecord extends Doctrine_Record $this->hasColumn('name', 'string', null, 'primary'); $this->hasColumn('code', 'integer', null, 'primary'); - $this->option('engine', 'INNODB'); + $this->option('type', 'INNODB'); } } ?> diff --git a/tests/Query/MultiJoinTestCase.php b/tests/Query/MultiJoinTestCase.php index 7f6be6b0b..29cbbd8aa 100644 --- a/tests/Query/MultiJoinTestCase.php +++ b/tests/Query/MultiJoinTestCase.php @@ -1,7 +1,36 @@ . + */ + +/** + * Doctrine_Query_MultiJoin_TestCase + * + * @package Doctrine + * @author Konsta Vesterinen + * @license http://www.opensource.org/licenses/lgpl-license.php LGPL + * @category Object Relational Mapping + * @link www.phpdoctrine.com + * @since 1.0 + * @version $Revision$ + */ class Doctrine_Query_MultiJoin_TestCase extends Doctrine_UnitTestCase { - - public function testInitializeData() { $query = new Doctrine_Query($this->connection); diff --git a/tests/Query/ReferenceModelTestCase.php b/tests/Query/ReferenceModelTestCase.php index 442098324..4e9d312a4 100644 --- a/tests/Query/ReferenceModelTestCase.php +++ b/tests/Query/ReferenceModelTestCase.php @@ -10,6 +10,8 @@ class Doctrine_Query_ReferenceModel_TestCase extends Doctrine_UnitTestCase { parent::prepareTables(); $this->connection->clear(); } + public function prepareData() + { } public function testInitializeData() { $query = new Doctrine_Query($this->connection); diff --git a/tests/Relation/AccessTestCase.php b/tests/Relation/AccessTestCase.php index ddcd12a49..09683b636 100644 --- a/tests/Relation/AccessTestCase.php +++ b/tests/Relation/AccessTestCase.php @@ -70,7 +70,7 @@ class Doctrine_Relation_Access_TestCase extends Doctrine_UnitTestCase { } public function prepareTables() { - $this->tables = array("MyUser", + $this->tables += array("MyUser", "MyOneThing", "MyUserOneThing", "MyOtherThing",