/**
  * @covers Sonata\AdminBundle\Admin\Admin::hasChild
  * @covers Sonata\AdminBundle\Admin\Admin::addChild
  * @covers Sonata\AdminBundle\Admin\Admin::getChild
  * @covers Sonata\AdminBundle\Admin\Admin::isChild
  * @covers Sonata\AdminBundle\Admin\Admin::hasChildren
  * @covers Sonata\AdminBundle\Admin\Admin::getChildren
  */
 public function testChildren()
 {
     $postAdmin = new PostAdmin('sonata.post.admin.post', 'Application\\Sonata\\NewsBundle\\Entity\\Post', 'SonataNewsBundle:PostAdmin');
     $this->assertFalse($postAdmin->hasChildren());
     $this->assertFalse($postAdmin->hasChild('comment'));
     $commentAdmin = new CommentAdmin('sonata.post.admin.comment', 'Application\\Sonata\\NewsBundle\\Entity\\Comment', 'SonataNewsBundle:CommentAdmin');
     $postAdmin->addChild($commentAdmin);
     $this->assertTrue($postAdmin->hasChildren());
     $this->assertTrue($postAdmin->hasChild('sonata.post.admin.comment'));
     $this->assertEquals('sonata.post.admin.comment', $postAdmin->getChild('sonata.post.admin.comment')->getCode());
     $this->assertEquals('sonata.post.admin.post|sonata.post.admin.comment', $postAdmin->getChild('sonata.post.admin.comment')->getBaseCodeRoute());
     $this->assertEquals($postAdmin, $postAdmin->getChild('sonata.post.admin.comment')->getParent());
     $this->assertFalse($postAdmin->isChild());
     $this->assertTrue($commentAdmin->isChild());
     $this->assertEquals(array('sonata.post.admin.comment' => $commentAdmin), $postAdmin->getChildren());
 }