Yaffs site version 1.1
[yaffs-website] / vendor / twig / twig / test / Twig / Tests / FileExtensionEscapingStrategyTest.php
1 <?php
2
3 /*
4  * This file is part of Twig.
5  *
6  * (c) Fabien Potencier
7  *
8  * For the full copyright and license information, please view the LICENSE
9  * file that was distributed with this source code.
10  */
11
12 class Twig_Tests_FileExtensionEscapingStrategyTest extends PHPUnit_Framework_TestCase
13 {
14     /**
15      * @dataProvider getGuessData
16      */
17     public function testGuess($strategy, $filename)
18     {
19         $this->assertSame($strategy, Twig_FileExtensionEscapingStrategy::guess($filename));
20     }
21
22     public function getGuessData()
23     {
24         return array(
25             // default
26             array('html', 'foo.html'),
27             array('html', 'foo.html.twig'),
28             array('html', 'foo'),
29             array('html', 'foo.bar.twig'),
30             array('html', 'foo.txt/foo'),
31             array('html', 'foo.txt/foo.js/'),
32
33             // css
34             array('css', 'foo.css'),
35             array('css', 'foo.css.twig'),
36             array('css', 'foo.twig.css'),
37             array('css', 'foo.js.css'),
38             array('css', 'foo.js.css.twig'),
39
40             // js
41             array('js', 'foo.js'),
42             array('js', 'foo.js.twig'),
43             array('js', 'foo.txt/foo.js'),
44             array('js', 'foo.txt.twig/foo.js'),
45
46             // txt
47             array(false, 'foo.txt'),
48             array(false, 'foo.txt.twig'),
49         );
50     }
51 }