protected function AsseticExtensionTest::setUp

File

drupal/core/vendor/kriswallsmith/assetic/tests/Assetic/Test/Extension/Twig/AsseticExtensionTest.php, line 24

Class

AsseticExtensionTest

Namespace

Assetic\Test\Extension\Twig

Code

protected function setUp() {
  if (!class_exists('Twig_Environment')) {
    $this
      ->markTestSkipped('Twig is not installed.');
  }
  $this->am = $this
    ->getMock('Assetic\\AssetManager');
  $this->fm = $this
    ->getMock('Assetic\\FilterManager');
  $this->valueSupplier = $this
    ->getMock('Assetic\\ValueSupplierInterface');
  $this->factory = new AssetFactory(__DIR__ . '/templates');
  $this->factory
    ->setAssetManager($this->am);
  $this->factory
    ->setFilterManager($this->fm);
  $this->twig = new \Twig_Environment();
  $this->twig
    ->setLoader(new \Twig_Loader_Filesystem(__DIR__ . '/templates'));
  $this->twig
    ->addExtension(new AsseticExtension($this->factory, array(), $this->valueSupplier));
}