Permalink
Browse files

Add test if multiple pks in parent table

  • Loading branch information...
1 parent 2c2fd11 commit d6aabbb1d8c9d107a082ae0bb4790974ef9dcba6 @willdurand willdurand committed Jul 2, 2012
Showing with 23 additions and 0 deletions.
  1. +23 −0 tests/EqualNestBehaviorTest.php
@@ -440,6 +440,29 @@ public function testNoParentParameterThrowsException()
</behavior>
</table>
</database>
+XML;
+ $this->getBuilder($schema)->build();
+ }
+
+ /**
+ * @expectedException RuntimeException
+ */
+ public function testMultiplePksInParentTableThrowsException()
+ {
+ $schema = <<<XML
+<database name="equal_nest_behavior_3">
+ <table name="person_3">
+ <column name="id" required="true" primaryKey="true" autoIncrement="true" type="INTEGER" />
+ <column name="id_2" required="true" primaryKey="true" autoIncrement="true" type="INTEGER" />
+ <column name="name" type="VARCHAR" required="true" />
+ </table>
+
+ <table name="friend_3">
+ <behavior name="equal_nest">
+ <parameter name="parent_table" value="person_3" />
+ </behavior>
+ </table>
+</database>
XML;
$this->getBuilder($schema)->build();
}

0 comments on commit d6aabbb

Please sign in to comment.