Exemplo n.º 1
0
 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');
     }
 }
Exemplo n.º 2
0
 public function setValues(array $values)
 {
     parent::setValues($values);
     $this->initialized = false;
 }
Exemplo n.º 3
0
 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");
     }
 }