public function setUp() { $this->asset = $this->getMock('Assetic\\Asset\\AssetInterface'); $parameters = array('foo' => 'foo value', 'bar' => 'bar value', 'foo.bar' => 'foo dot bar value', 'null' => null, 'quotes' => '"aren\'t quotes wonderful"', 'array' => array('test' => 'something')); $this->parameterBag = $this->getMock('Symfony\\Component\\DependencyInjection\\ParameterBag\\ParameterBagInterface'); $this->parameterBag->expects($this->any())->method('get')->will($this->returnCallback(function ($key) use($parameters) { return $parameters[$key]; })); $this->parameterBag->expects($this->any())->method('has')->will($this->returnCallback(function ($key) use($parameters) { return array_key_exists($key, $parameters); })); }