Exemple #1
0
 public function testSaveObjectWithNewChildren()
 {
     $a = new LeanObject("TestObject");
     $b = new LeanObject("TestObject");
     $c = new LeanObject("TestObject");
     $a->set("foo", "aar");
     $b->set("foo", "bar");
     $c->set("foo", "car");
     $a->set("mylikes", array($b, "foo"));
     $a->set("dislikes", array($c, 42));
     $a->save();
     $this->assertNotEmpty($a->getObjectId());
     $this->assertNotEmpty($b->getObjectId());
     $this->assertNotEmpty($c->getObjectId());
     LeanObject::destroyAll(array($a, $b, $c));
 }