当前位置: 首页>>代码示例>>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;未经允许,请勿转载。