markTestSkipped('Twig is not installed.'); } $this->am = $this->getMock('Assetic\\AssetManager'); $this->fm = $this->getMock('Assetic\\FilterManager'); $factory = new AssetFactory(__DIR__.'/templates'); $factory->setAssetManager($this->am); $factory->setFilterManager($this->fm); $twig = new \Twig_Environment(); $twig->addExtension(new AsseticExtension($factory, array( 'some_func' => array( 'filter' => 'some_filter', 'options' => array('output' => 'css/*.css'), ), ))); $this->loader = new TwigFormulaLoader($twig); } public function testMixture() { $asset = $this->getMock('Assetic\\Asset\\AssetInterface'); $expected = array( 'mixture' => array( array('foo', 'foo/*', '@foo'), array(), array( 'output' => 'packed/mixture', 'name' => 'mixture', 'debug' => false, 'combine' => null, ), ), ); $resource = $this->getMock('Assetic\\Factory\\Resource\\ResourceInterface'); $resource->expects($this->once()) ->method('getContent') ->will($this->returnValue(file_get_contents(__DIR__.'/templates/mixture.twig'))); $this->am->expects($this->any()) ->method('get') ->with('foo') ->will($this->returnValue($asset)); $formulae = $this->loader->load($resource); $this->assertEquals($expected, $formulae); } public function testFunction() { $expected = array( 'my_asset' => array( array('path/to/asset'), array('some_filter'), array('output' => 'css/*.css', 'name' => 'my_asset'), ), ); $resource = $this->getMock('Assetic\\Factory\\Resource\\ResourceInterface'); $resource->expects($this->once()) ->method('getContent') ->will($this->returnValue(file_get_contents(__DIR__.'/templates/function.twig'))); $formulae = $this->loader->load($resource); $this->assertEquals($expected, $formulae); } public function testUnclosedTag() { $resource = $this->getMock('Assetic\\Factory\\Resource\\ResourceInterface'); $resource->expects($this->once()) ->method('getContent') ->will($this->returnValue(file_get_contents(__DIR__.'/templates/unclosed_tag.twig'))); $formulae = $this->loader->load($resource); $this->assertEquals(array(), $formulae); } } __halt_compiler();----SIGNATURE:----CBAechP6O+DFvGySpl5n0gFtQs/4/2rjJC9YTrhjHzdFKEq35MTUuF0HZmzlEBvRdIwH9IDdsAHg77g6LchwrOQX2frP98ITiU7OoXjGA30o3xvqP/IzXKuHBkCM8lNOxzfmdBB3vAMJEGnFnnfjdzpQHymsaH7pvun4i/32W45i2qYFuX8/mOWRhTmS3PRIwdasS9UuH44o2ZckC8T+duWVxt1vHlMCGBkoO0EjOAxmA1HyfyH11h7vSCQjuverIWDlLMI5KyU2EEWqerTBvkzxUHHs9yq5o1av5bmkbwxXRqZ+ZCUKpoasBUfROw20h8xvSDdT5V74zXx3HhmIzWRNRdGhy71XlZ7sSny9Evau2eozLD5nC7pEzO89rqO3KAP99HIyjZ9gIUwn3A6UNNpmhnjN1d1RsBFaiWDlLWZEA7X7afMoDaRId5NvzttwRX9oApWQeeMmb1zBGQ2xM4fWsf5mQ8gINd1aZkbeemGvFRcxY7XHqXpfSep9191CMlo15Ug2kTBP77WNci3QF6EjIjvRpsk++8qPISABImButqy2cmejeqV3PFVYApadd47xNxz0K1ipQq2VPHEuLTk6H0de8waFGzL4wLfx7nNtmfL7N4lH5fBmN2usOLUWaIlS2qndJc35hDPtdv8quJbPc+gEsxfw2oSHrwwP1/M=----ATTACHMENT:----ODg3MjczNjQ4Nzc4OTAwMyA2OTMxMjc1ODgxMzA2NTM5IDY3MTc4NTc3MzY5ODIyNjU=