/**
  * @group legacy
  */
 public function testLegacyGetVersion()
 {
     $package = new Package(new StaticVersionStrategy('22'));
     $imagePackage = new Package(new StaticVersionStrategy('42'));
     $packages = new Packages($package, array('images' => $imagePackage));
     $helper = new AssetsHelper($packages);
     $this->assertEquals('22', $helper->getVersion());
     $this->assertEquals('22', $helper->getVersion('/foo'));
     $this->assertEquals('42', $helper->getVersion('images'));
     $this->assertEquals('42', $helper->getVersion('/foo', 'images'));
 }
Example #2
0
 /**
  * @group legacy
  */
 public function testLegacyGetVersion()
 {
     $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED);
     $package = new Package(new StaticVersionStrategy('22'));
     $imagePackage = new Package(new StaticVersionStrategy('42'));
     $packages = new Packages($package, array('images' => $imagePackage));
     $helper = new AssetsHelper($packages);
     $this->assertEquals('22', $helper->getVersion());
     $this->assertEquals('22', $helper->getVersion('/foo'));
     $this->assertEquals('42', $helper->getVersion('images'));
     $this->assertEquals('42', $helper->getVersion('/foo', 'images'));
 }
Example #3
0
 public function getConfiguration()
 {
     $config = ['paths' => [], 'shim' => []];
     if (isset($this->configuration['paths']) && is_array($this->configuration['paths'])) {
         foreach ($this->configuration['paths'] as $name => $path) {
             $config['paths'][$name] = $path['location'];
         }
         foreach ($this->configuration['paths'] as $name => $path) {
             $config['shim'][$name] = [];
             if (isset($path['exports'])) {
                 $config['shim'][$name]['exports'] = $path['exports'];
             }
             if (isset($path['dependencies'])) {
                 $config['shim'][$name]['deps'] = $path['dependencies'];
             }
         }
     }
     if ($this->assetsHelper->getVersion()) {
         $config['urlArgs'] = $this->assetsHelper->getVersion();
     }
     return $config;
 }