Ejemplo n.º 1
0
 public function testExtension()
 {
     $extension = new TwigExtension(__DIR__, '/', '/bundles');
     $this->assertEquals('webpack', $extension->getName());
     $this->assertCount(2, $extension->getFunctions());
     $this->assertCount(1, $extension->getTokenParsers());
     $this->assertEquals(['js' => false, 'css' => false], $extension->webpackAsset('@AppBundle/app.js'));
 }
Ejemplo n.º 2
0
 public function testExtension()
 {
     $extension = new TwigExtension(__DIR__, '/', '/bundles', '/shared.js', '/shared.css');
     $this->assertEquals('webpack', $extension->getName());
     $this->assertEquals(['js' => false, 'css' => false], $extension->webpackAsset('@AppBundle/app.js'));
     $this->assertEquals('/shared.js?0', $extension->webpackCommonJs());
     $this->assertEquals('/shared.css?0', $extension->webpackCommonCss());
 }
Ejemplo n.º 3
0
 public function testGetName()
 {
     $extension = new TwigExtension(new \ArrayObject());
     $this->assertSame('puppy-twig-extension', $extension->getName());
 }
 /**
  * @covers DataUri\TwigExtension::getName
  */
 public function testGetName()
 {
     $this->assertEquals('data_uri_twig_extension', $this->extension->getName());
 }