Example #1
0
 /**
  * Combines JavaScript and StyleSheet assets.
  * @param string $name Combined file code
  * @return string Combined content.
  */
 public function combine($name)
 {
     try {
         if (!strpos($name, '-')) {
             throw new CmsException(Lang::get('cms::lang.combiner.not_found', ['name' => $name]));
         }
         $parts = explode('-', $name);
         $cacheId = $parts[0];
         $combiner = new CombineAssets();
         return $combiner->getContents($cacheId);
     } catch (Exception $ex) {
         return '/* ' . $ex->getMessage() . ' */';
     }
 }
 public function testResetCache()
 {
     $combiner = new CombineAssets();
     $this->assertNull($combiner->resetCache());
 }