Esempio n. 1
0
 public function testGrunt()
 {
     $groups = new ResourceGroups();
     $groups->addGroup('grunt_scss');
     $res = new StyleSheetResourceManager($groups, function (StyleSheetResource $res) {
         $combine = new StyleSheetCombineFiles();
         $combine->setInputDir(__DIR__)->setOutputDir(__DIR__ . '/tmp/cache')->setOutputBaseUrl('/tmp/cache')->setOutputForceRefresh(true)->setOutputLifeTime(0)->setOutputStrategy('manual')->setCacheDb(CombineFilesCacheDB::openFile(__DIR__ . '/tmp/cache/grunt.db'))->setScssImportDirs(array(__DIR__ . '/tmp/scss/grunt_import', __DIR__ . '/tmp/scss/grunt', __DIR__))->setScssVariables(array('path-background' => '"/images/bg.png"', 'foo' => 'red'));
         $url = new UrlManager();
         $res->setCombineObject($combine);
         $res->setUrlManager($url);
     });
     $res->add(new StyleSheetResource('style', array('/tmp/scss/style.scss,grunt'), array('combine' => true)), 'grunt_scss');
     $this->assertNotEmpty($res->render('html'));
 }