本文整理匯總了PHP中Sonata\AdminBundle\Admin\Pool::getDashboardGroups方法的典型用法代碼示例。如果您正苦於以下問題:PHP Pool::getDashboardGroups方法的具體用法?PHP Pool::getDashboardGroups怎麽用?PHP Pool::getDashboardGroups使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Sonata\AdminBundle\Admin\Pool
的用法示例。
在下文中一共展示了Pool::getDashboardGroups方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testGetDashboardGroups
public function testGetDashboardGroups()
{
$admin_group1 = $this->getMock('Sonata\\AdminBundle\\Admin\\AdminInterface');
$admin_group1->expects($this->once())->method('showIn')->will($this->returnValue(true));
$admin_group2 = $this->getMock('Sonata\\AdminBundle\\Admin\\AdminInterface');
$admin_group2->expects($this->once())->method('showIn')->will($this->returnValue(false));
$container = $this->getMock('Symfony\\Component\\DependencyInjection\\ContainerInterface');
$container->expects($this->any())->method('get')->will($this->onConsecutiveCalls($admin_group1, $admin_group2));
$pool = new Pool($container, 'Sonata Admin', '/path/to/pic.png');
$pool->setAdminGroups(array('adminGroup1' => array('items' => array('itemKey' => 'sonata.user.admin.group1')), 'adminGroup2' => array('itmes' => array('itemKey' => 'sonata.user.admin.group1')), 'adminGroup3' => array('items' => array('itemKey' => 'sonata.user.admin.group2'))));
$groups = $pool->getDashboardGroups();
$this->assertCount(1, $groups);
}