public function testMultipleSameVariableValues() { $vars = array('locale'); $asset = new FileAsset(__DIR__ . '/../Fixture/messages.{locale}.js', array(), null, null, $vars); $coll = new AssetCollection(array($asset), array(), null, $vars); $coll->setTargetPath('output.{locale}.js'); $coll->setValues(array('locale' => 'en')); foreach ($coll as $asset) { $this->assertEquals('output.{locale}_messages._1.js', $asset->getTargetPath(), 'targetPath must not contain several time the same variable'); } }
public function setValues(array $values) { parent::setValues($values); $this->initialized = false; }
public function testGetLastModifiedWithValues() { $vars = array('locale'); $asset = new FileAsset(__DIR__ . '/../Fixture/messages.{locale}.js', array(), null, null, $vars); $coll = new AssetCollection(array($asset), array(), null, $vars); $coll->setValues(array('locale' => 'en')); try { $coll->getLastModified(); } catch (\InvalidArgumentException $e) { $this->fail("->getLastModified() shouldn't fail for assets with vars"); } }