public createAssetFactory ( array $configuration ) : Assetic\Factory\AssetFactory | ||
$configuration | array | |
Résultat | Assetic\Factory\AssetFactory |
public function createAssetFactory(array $configuration)
{
$factory = new Factory\AssetFactory($configuration['root_path']);
$factory->setAssetManager($this->getAssetManager());
$factory->setFilterManager($this->getFilterManager());
$worker = $this->getCacheBusterStrategy();
if ($worker instanceof WorkerInterface) {
$factory->addWorker($worker);
}
$factory->setDebug($this->configuration->isDebug());
return $factory;
}
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); }