Beispiel #1
0
 /**
  * Convert any globs in an Angular module to file names.
  *
  * @param array $modules
  *   List of Angular modules.
  * @return array
  *   Updated list of Angular modules
  */
 protected function resolvePatterns($modules)
 {
     $newModules = array();
     foreach ($modules as $moduleKey => $module) {
         foreach (array('js', 'css', 'partials') as $fileset) {
             if (!isset($module[$fileset])) {
                 continue;
             }
             $module[$fileset] = $this->res->glob($module['ext'], $module[$fileset]);
         }
         $newModules[$moduleKey] = $module;
     }
     return $newModules;
 }
 public function testGlob()
 {
     $this->assertEquals(array('info.xml'), $this->res->glob('com.example.ext', 'info.xml'));
     $this->assertEquals(array('js/example.js'), $this->res->glob('com.example.ext', 'js/*.js'));
     $this->assertEquals(array('js/example.js'), $this->res->glob('com.example.ext', array('js/*.js')));
 }