tests/FileExtensionEscapingStrategyTest.php
4481bf5f
 <?php
 
2119e60c
 namespace Twig\Tests;
 
4481bf5f
 /*
  * This file is part of Twig.
  *
  * (c) Fabien Potencier
  *
  * For the full copyright and license information, please view the LICENSE
  * file that was distributed with this source code.
  */
 
34bdab4d
 use PHPUnit\Framework\TestCase;
1ddb8253
 use Twig\FileExtensionEscapingStrategy;
 
34bdab4d
 class FileExtensionEscapingStrategyTest extends TestCase
4481bf5f
 {
     /**
      * @dataProvider getGuessData
      */
     public function testGuess($strategy, $filename)
     {
1ddb8253
         $this->assertSame($strategy, FileExtensionEscapingStrategy::guess($filename));
4481bf5f
     }
 
     public function getGuessData()
     {
5c55243d
         return [
4481bf5f
             // default
5c55243d
             ['html', 'foo.html'],
             ['html', 'foo.html.twig'],
             ['html', 'foo'],
             ['html', 'foo.bar.twig'],
             ['html', 'foo.txt/foo'],
             ['html', 'foo.txt/foo.js/'],
4481bf5f
 
             // css
5c55243d
             ['css', 'foo.css'],
             ['css', 'foo.css.twig'],
             ['css', 'foo.twig.css'],
             ['css', 'foo.js.css'],
             ['css', 'foo.js.css.twig'],
4481bf5f
 
             // js
5c55243d
             ['js', 'foo.js'],
             ['js', 'foo.js.twig'],
             ['js', 'foo.txt/foo.js'],
             ['js', 'foo.txt.twig/foo.js'],
4481bf5f
 
             // txt
5c55243d
             [false, 'foo.txt'],
             [false, 'foo.txt.twig'],
         ];
4481bf5f
     }
 }