コード例 #1
0
ファイル: ManagerTest.php プロジェクト: rafalwrzeszcz/zf2
 public function testModuleLoadingBehavior()
 {
     $moduleManager = new Manager(array('BarModule'));
     $moduleManager->events()->attachAggregate($this->defaultListeners);
     $modules = $moduleManager->getLoadedModules();
     $this->assertSame(0, count($modules));
     $modules = $moduleManager->getLoadedModules(true);
     $this->assertSame(1, count($modules));
     $moduleManager->loadModules();
     // should not cause any problems
     $moduleManager->loadModule('BarModule');
     // should not cause any problems
     $modules = $moduleManager->getLoadedModules(true);
     // BarModule already loaded so nothing happens
     $this->assertSame(1, count($modules));
 }