Skip to content
Browse files

removed configuration method to avoid abuse

  • Loading branch information...
1 parent 191365a commit 6e319d34241382fdb8ab0c9a40531dcf9300e0a5 @kriswallsmith committed Jul 15, 2011
Showing with 4 additions and 9 deletions.
  1. +0 −5 src/Assetic/Filter/TwigFilter.php
  2. +4 −4 tests/Assetic/Test/Filter/TwigFilterTest.php
View
5 src/Assetic/Filter/TwigFilter.php
@@ -29,11 +29,6 @@ public function __construct(\Twig_Environment $twig, array $context = array())
$this->context = $context;
}
- public function addContextValue($name, $value)
- {
- $this->context[$name] = $value;
- }
-
public function filterLoad(AssetInterface $asset)
{
$name = 'assetic_'.substr(sha1(time().rand(11111, 99999)), 0, 7);
View
8 tests/Assetic/Test/Filter/TwigFilterTest.php
@@ -34,15 +34,15 @@ protected function setUp()
->will($this->returnValue(sha1(rand(11111, 99999))));
$this->twig = new \Twig_Environment($this->loader);
- $this->filter = new TwigFilter($this->twig);
}
public function testFilterLoad()
{
$asset = new StringAsset('{{ "foobar"|upper ~ "baz" }}');
$asset->load();
- $this->filter->filterLoad($asset);
+ $filter = new TwigFilter($this->twig);
+ $filter->filterLoad($asset);
$this->assertEquals('FOOBARbaz', $asset->getContent(), '->filterLoad() parses the asset as a Twig template');
}
@@ -52,8 +52,8 @@ public function testContext()
$asset = new StringAsset('{{ foobar }}');
$asset->load();
- $this->filter->addContextValue('foobar', 'ok');
- $this->filter->filterLoad($asset);
+ $filter = new TwigFilter($this->twig, array('foobar' => 'ok'));
+ $filter->filterLoad($asset);
$this->assertEquals('ok', $asset->getContent(), '->filterLoad() includes context values from the filter');
}

0 comments on commit 6e319d3

Please sign in to comment.
Something went wrong with that request. Please try again.