Esempio n. 1
0
 /**
  * @return CompilerInterface|null
  */
 public function getMinifier()
 {
     if (!$this->minifier instanceof CompilerInterface) {
         switch (true) {
             case is_array($this->minifier):
                 $this->minifier = CompilerFactory::factory($this->minifier);
                 break;
             case $this->minifier == null:
                 $this->minifier = CompilerFactory::factory('unify');
                 break;
             default:
         }
     }
     return $this->minifier;
 }
Esempio n. 2
0
 /**
  * @param string $pp
  * @return array|CompilerInterface
  */
 public function getPreprocessor($pp = 'Unify')
 {
     if (!$this->preprocessor instanceof CompilerInterface) {
         switch (true) {
             case is_array($this->preprocessor):
                 $this->preprocessor['compiler'] = array('tool' => '\\Netis\\Code\\Css\\Compiler\\' . ucfirst($pp));
                 $this->preprocessor = CompilerFactory::factory($this->preprocessor);
                 break;
             case $this->preprocessor == null:
                 $this->preprocessor = new Unify();
                 break;
             default:
         }
     }
     return $this->preprocessor;
 }
Esempio n. 3
0
 public function setUp()
 {
     $this->compile = CompilerFactory::factory(array('tool' => 'minify', 'code' => 'js'));
 }
Esempio n. 4
0
 /**
  * @expectedException \Athem\Exception\InvalidResource
  */
 public function testCompilerExceptionNoCacheDefined()
 {
     $this->compiler = CompilerFactory::factory(array('tool' => '\\Athcore\\Code\\CachedCompiler', 'minifier' => array('tool' => 'unify')));
 }
Esempio n. 5
0
 public function testJs()
 {
     $this->assertTrue(Code\CompilerFactory::factory(array('tool' => 'yui', 'code' => 'js')) instanceof Code\Js\Compiler\Yui);
     $this->assertTrue(Code\CompilerFactory::factory(array('tool' => 'minify', 'code' => 'js')) instanceof Code\Js\Compiler\Minify);
 }
Esempio n. 6
0
 public function setUp()
 {
     $this->compile = CompilerFactory::factory(array('tool' => 'yui', 'code' => 'css'));
 }