示例#1
0
 public function testAdd()
 {
     $group = new EmbeddedGroup('Model\\Comment');
     $group->setRootAndPath($article = $this->mandango->create('Model\\Article'), 'comments');
     $comment = $this->mandango->create('Model\\Comment');
     $group->add($comment);
     $this->assertSame(array('root' => $article, 'path' => 'comments._add0'), $comment->getRootAndPath());
 }
示例#2
0
 public function testAdd()
 {
     $group = new EmbeddedGroup('Model\\Comment');
     $group->setRootAndPath($article = $this->mandango->create('Model\\Article'), 'comments');
     $comment = $this->mandango->create('Model\\Comment');
     $group->add($comment);
     $this->assertEquals($article, $comment->_root);
     $this->assertEquals('comments._add0', $comment->_path);
 }