當前位置: 首頁>>代碼示例>>PHP>>正文


PHP FileAsset::load方法代碼示例

本文整理匯總了PHP中Assetic\Asset\FileAsset::load方法的典型用法代碼示例。如果您正苦於以下問題:PHP FileAsset::load方法的具體用法?PHP FileAsset::load怎麽用?PHP FileAsset::load使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Assetic\Asset\FileAsset的用法示例。


在下文中一共展示了FileAsset::load方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: testLazyLoading

 public function testLazyLoading()
 {
     $asset = new FileAsset(__FILE__);
     $this->assertEmpty($asset->getContent(), 'The asset content is empty before load');
     $asset->load();
     $this->assertNotEmpty($asset->getContent(), 'The asset content is not empty after load');
 }
開發者ID:alexanderTsig,項目名稱:arabic,代碼行數:7,代碼來源:FileAssetTest.php

示例2: testCompassMixin

 public function testCompassMixin()
 {
     $asset = new FileAsset(__DIR__ . '/fixtures/compass/compass.sass');
     $asset->load();
     $this->filter->filterLoad($asset);
     $this->assertContains('text-decoration', $asset->getContent());
 }
開發者ID:alexanderTsig,項目名稱:arabic,代碼行數:7,代碼來源:CompassFilterTest.php

示例3: testCompassExtensionCanBeDisabled

 public function testCompassExtensionCanBeDisabled()
 {
     $this->setExpectedException("Exception", "Undefined mixin box-shadow: failed at `@include box-shadow(10px " . "10px 8px red);` line: 4");
     $asset = new FileAsset(__DIR__ . '/fixtures/sass/main_compass.scss');
     $asset->load();
     $this->getFilter(false)->filterLoad($asset);
 }
開發者ID:selimcr,項目名稱:servigases,代碼行數:7,代碼來源:ScssphpFilterTest.php

示例4: testRelativeSourceUrlImportImports

 public function testRelativeSourceUrlImportImports()
 {
     $asset = new FileAsset(__DIR__ . '/fixtures/jsmin/js.js');
     $asset->load();
     $filter = new JSqueezeFilter();
     $filter->filterDump($asset);
     $this->assertEquals(";var a='abc',bbb='u';", $asset->getContent());
 }
開發者ID:kebenxiaoming,項目名稱:owncloudRedis,代碼行數:8,代碼來源:JSqueezeFilterTest.php

示例5: testPacker

 public function testPacker()
 {
     $asset = new FileAsset(__DIR__ . '/fixtures/packer/example.js');
     $asset->load();
     $filter = new PackerFilter();
     $filter->filterDump($asset);
     $this->assertEquals("var exampleFunction=function(arg1,arg2){alert('exampleFunction called!')}", $asset->getContent());
 }
開發者ID:selimcr,項目名稱:servigases,代碼行數:8,代碼來源:PackerFilterTest.php

示例6: testRelativeSourceUrlImportImports

 public function testRelativeSourceUrlImportImports()
 {
     $asset = new FileAsset(__DIR__ . '/fixtures/jsmin/js.js');
     $asset->load();
     $filter = new JSMinFilter();
     $filter->filterDump($asset);
     $this->assertEquals('var a="abc";;;var bbb="u";', $asset->getContent());
 }
開發者ID:alexanderTsig,項目名稱:arabic,代碼行數:8,代碼來源:JSMinFilterTest.php

示例7: testRelativeSourceUrlImportImports

 public function testRelativeSourceUrlImportImports()
 {
     $asset = new FileAsset(__DIR__ . '/fixtures/minifycsscompressor/main.css');
     $asset->load();
     $filter = new MinifyCssCompressorFilter();
     $filter->filterDump($asset);
     $this->assertEquals('body{color:white}body{background:black}', $asset->getContent());
 }
開發者ID:selimcr,項目名稱:servigases,代碼行數:8,代碼來源:MinifyCssCompressorFilterTest.php

示例8: testNonCssImport

 public function testNonCssImport()
 {
     $asset = new FileAsset(__DIR__ . '/fixtures/cssimport/noncssimport.css', array(), __DIR__ . '/fixtures/cssimport', 'noncssimport.css');
     $asset->load();
     $filter = new CssImportFilter();
     $filter->filterLoad($asset);
     $this->assertEquals(file_get_contents(__DIR__ . '/fixtures/cssimport/noncssimport.css'), $asset->getContent(), '->filterLoad() skips non css');
 }
開發者ID:selimcr,項目名稱:servigases,代碼行數:8,代碼來源:CssImportFilterTest.php

示例9: testFileAsset

 public function testFileAsset()
 {
     $asset = new FileAsset(__DIR__ . '/fixtures/handlebars/template.handlebars');
     $asset->load();
     $this->filter->filterLoad($asset);
     $this->assertNotContains('{{ var }}', $asset->getContent());
     $this->assertContains('Ember.TEMPLATES["template"]', $asset->getContent());
     $this->assertContains('data.buffer.push("<div id=\\"test\\"><h2>");', $asset->getContent());
 }
開發者ID:selimcr,項目名稱:servigases,代碼行數:9,代碼來源:EmberPrecompileFilterTest.php

示例10: testMinimizeHandlebars

 public function testMinimizeHandlebars()
 {
     $asset = new FileAsset(__DIR__ . '/fixtures/handlebars/template.handlebars');
     $asset->load();
     $this->filter->setMinimize(true);
     $this->filter->filterLoad($asset);
     $this->assertNotContains('{{ var }}', $asset->getContent());
     $this->assertNotContains("\n", $asset->getContent());
 }
開發者ID:selimcr,項目名稱:servigases,代碼行數:9,代碼來源:HandlebarsFilterTest.php

示例11: testCssEmbedMhtml

 public function testCssEmbedMhtml()
 {
     $asset = new FileAsset(__DIR__ . '/fixtures/cssembed/test.css');
     $asset->load();
     $this->filter->setMhtml(true);
     $this->filter->setMhtmlRoot('/test');
     $this->filter->filterDump($asset);
     $this->assertContains('url(mhtml:/test/!', $asset->getContent());
 }
開發者ID:alexanderTsig,項目名稱:arabic,代碼行數:9,代碼來源:CssEmbedFilterTest.php

示例12: testCompilation

 public function testCompilation()
 {
     $asset = new FileAsset(__DIR__ . '/stubs/coffeescript/script.coffee');
     $asset->load();
     $filter = new CoffeeScriptphpFilter();
     $filter->filterLoad($asset);
     $expected = file_get_contents(__DIR__ . '/stubs/coffeescript/script.js');
     $this->assertEquals($expected, $asset->getContent());
 }
開發者ID:sohailaammarocs,項目名稱:lfc,代碼行數:9,代碼來源:CoffescriptphpFilterTest.php

示例13: testRelativeSourceUrlImportImports

 public function testRelativeSourceUrlImportImports()
 {
     $asset = new FileAsset(__DIR__ . '/fixtures/cssmin/main.css');
     $asset->load();
     $filter = new CssMinFilter(__DIR__ . '/fixtures/cssmin');
     $filter->setFilter('ImportImports', true);
     $filter->filterDump($asset);
     $this->assertEquals('body{color:white}body{background:black}', $asset->getContent());
 }
開發者ID:laubosslink,項目名稱:lab,代碼行數:9,代碼來源:CssMinFilterTest.php

示例14: testCssEmbedDataUri

 public function testCssEmbedDataUri()
 {
     $data = base64_encode(file_get_contents(__DIR__ . '/fixtures/home.png'));
     $asset = new FileAsset(__DIR__ . '/fixtures/cssembed/test.css');
     $asset->load();
     $filter = new PhpCssEmbedFilter();
     $filter->filterLoad($asset);
     $this->assertContains('url(data:image/png;base64,' . $data, $asset->getContent());
 }
開發者ID:alexanderTsig,項目名稱:arabic,代碼行數:9,代碼來源:PhpCssEmbedFilterTest.php

示例15: testCompilingWithImportPath

 public function testCompilingWithImportPath()
 {
     $asset = new FileAsset(__DIR__ . '/stubs/sass/style.sass');
     $asset->load();
     $filter = new SassphpFilter();
     $filter->addImportPath(__DIR__ . '/stubs/sass/import_path');
     $filter->filterLoad($asset);
     $expected = file_get_contents(__DIR__ . '/stubs/sass/style.css');
     $this->assertEquals($expected, $asset->getContent());
 }
開發者ID:sohailaammarocs,項目名稱:lfc,代碼行數:10,代碼來源:SassphpFilterTest.php


注:本文中的Assetic\Asset\FileAsset::load方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。