Permalink
Browse files

Test use parent PK type

Signed-off-by: Martin Richard <martius@martiusweb.net>
  • Loading branch information...
Martiusweb committed Sep 5, 2012
1 parent 1e2236c commit 5f2b77c9861543b8fb8db23245e47ab7c182dbd0
Showing with 26 additions and 0 deletions.
  1. +26 −0 tests/EqualNestBehaviorTest.php
@@ -466,4 +466,30 @@ public function testMultiplePksInParentTableThrowsException()
XML;
$this->getBuilder($schema)->build();
}
+
+ public function testPkMatchParentPkType(){
+ $schema = <<<XML
+<database name="equal_nest_behavior_4">
+ <table name="person_4">
+ <column name="id" required="true" primaryKey="true" autoIncrement="true" type="BIGINT" />
+ <column name="name" type="VARCHAR" required="true" />
+ </table>
+
+ <table name="friend_4">
+ <behavior name="equal_nest">
+ <parameter name="parent_table" value="person_4" />
+ </behavior>
+ </table>
+</database>
+XML;
+ $build = $this->getBuilder($schema)->build();
+ $parentTable = new Person4TableMap();
+ $table = new Friend4TableMap();
+
+ list($parentKey) = $parentTable->getPrimaryKeyColumns();
+ $pks = $table->getPrimaryKeyColumns();
+ foreach($pks as $pk) {
+ $this->assertTrue($pk->getType() === $parentKey->getType());
+ }
+ }
}

0 comments on commit 5f2b77c

Please sign in to comment.