public function testFindUnsavedChildren() { $a = new LeanObject("TestObject"); $b = new LeanObject("TestObject"); $c = new LeanObject("TestObject"); $a->set("likes", array($b, "foo")); $b->set("likes", array($c, 42)); $c->set("likes", $a); $unsavedChildren = $b->findUnsavedChildren(); $this->assertContains($c, $unsavedChildren); $this->assertContains($a, $unsavedChildren); // it should not contain $b $this->assertNotContains($b, $unsavedChildren); }