public function setUp() { $this->adminPool = new AdminPool(); $this->admin1 = $this->getMockForAbstractClass('Sulu\\Bundle\\AdminBundle\\Admin\\Admin', [], '', true, true, true, ['getCommands', 'getSecurityContexts']); $this->admin2 = $this->getMockForAbstractClass('Sulu\\Bundle\\AdminBundle\\Admin\\Admin', [], '', true, true, true, ['getCommands', 'getSecurityContexts']); $this->command = $this->getMock('Command'); $this->admin1->expects($this->any())->method('getCommands')->will($this->returnValue([new $this->command()])); $this->admin2->expects($this->any())->method('getCommands')->will($this->returnValue([new $this->command()])); $this->admin1->expects($this->any())->method('getSecurityContexts')->will($this->returnValue(['Sulu' => ['Assets' => ['assets.videos', 'assets.pictures', 'assets.documents']]])); $this->admin2->expects($this->any())->method('getSecurityContexts')->will($this->returnValue(['Sulu' => ['Portal' => ['portals.com', 'portals.de']]])); $rootItem1 = new NavigationItem('Root'); $rootItem1->addChild(new NavigationItem('Child1')); $this->admin1->setNavigation(new Navigation($rootItem1)); $rootItem2 = new NavigationItem('Root'); $rootItem2->addChild(new NavigationItem('Child2')); $this->admin2->setNavigation(new Navigation($rootItem2)); $this->adminPool->addAdmin($this->admin1); $this->adminPool->addAdmin($this->admin2); }
public function testNavigation() { $this->assertSame($this->navigation, $this->admin->getNavigation()); }