Exemplo n.º 1
0
 public function testGetAdminsByGroup()
 {
     $this->pool->setAdminServiceIds(array('sonata.admin1', 'sonata.admin2', 'sonata.admin3'));
     $this->pool->setAdminGroups(array('adminGroup1' => array('items' => array('sonata.admin1', 'sonata.admin2')), 'adminGroup2' => array('items' => array('sonata.admin3'))));
     $this->assertCount(2, $this->pool->getAdminsByGroup('adminGroup1'));
     $this->assertCount(1, $this->pool->getAdminsByGroup('adminGroup2'));
 }
Exemplo n.º 2
0
 public function testGetAdminsByGroup()
 {
     $this->pool->setAdminServiceIds(array('sonata.admin1', 'sonata.admin2', 'sonata.admin3'));
     $this->pool->setAdminGroups(array('adminGroup1' => array('items' => array($this->getItemArray('sonata.admin1'), $this->getItemArray('sonata.admin2'))), 'adminGroup2' => array('items' => array($this->getItemArray('sonata.admin3')))));
     $this->assertEquals(array('sonata_admin1_AdminClass', 'sonata_admin2_AdminClass'), $this->pool->getAdminsByGroup('adminGroup1'));
     $this->assertEquals(array('sonata_admin3_AdminClass'), $this->pool->getAdminsByGroup('adminGroup2'));
 }