getModule() публичный Метод

public getModule ( $name, $default = null )
Пример #1
0
 public function testCacheBusterStrategyWorker()
 {
     $factory = $this->object->createAssetFactory($this->configuration->getModule('test_application'));
     // no workers by default:
     $this->assertAttributeEquals(array(), 'workers', $factory);
     $cacheBusterStrategy = $this->getMock('AsseticBundle\\CacheBuster\\LastModifiedStrategy');
     $this->object->setCacheBusterStrategy($cacheBusterStrategy);
     $factory = $this->object->createAssetFactory($this->configuration->getModule('test_application'));
     // cache buster strategy is added to workers list:
     $this->assertAttributeEquals(array($cacheBusterStrategy), 'workers', $factory);
 }
Пример #2
0
 public function testGetModule()
 {
     $moduleName = 'SomeModule';
     $result = $this->object->getModule($moduleName);
     $this->assertNull($result);
     $expected = '123';
     $result = $this->object->getModule($moduleName, $expected);
     $this->assertEquals($expected, $result);
     $expected = array('name' => 'value');
     $data = array(strtoupper($moduleName) => $expected);
     $this->object->setModules($data);
     $result = $this->object->getModule($moduleName);
     $this->assertEquals($expected, $result);
 }