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));
}