Permalink
Browse files

Add test if 'parent' parameter not specified

  • Loading branch information...
1 parent 618e24b commit a46beaf8447a02dcbfa62ed3ac755e0760f04441 @willdurand willdurand committed Jul 2, 2012
Showing with 22 additions and 0 deletions.
  1. +22 −0 tests/EqualNestBehaviorTest.php
@@ -421,4 +421,26 @@ public function testFindFriendsOf()
$this->assertEquals(0, PersonQuery::create()->findFriendsOf($phil)->count());
$this->assertEquals(0, PersonQuery::create()->findFriendsOf($jean)->count());
}
+
+ /**
+ * @expectedException InvalidArgumentException
+ */
+ public function testNoParentParameterThrowsException()
+ {
+ $schema = <<<XML
+<database name="equal_nest_behavior_2">
+ <table name="person_2">
+ <column name="id" required="true" primaryKey="true" autoIncrement="true" type="INTEGER" />
+ <column name="name" type="VARCHAR" required="true" />
+ </table>
+
+ <table name="friend_2">
+ <behavior name="equal_nest">
+ <!-- mandatory parameter missing here -->
+ </behavior>
+ </table>
+</database>
+XML;
+ $this->getBuilder($schema)->build();
+ }
}

0 comments on commit a46beaf

Please sign in to comment.