This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/TemplateTest.php

37 lines
1.2 KiB
PHP
Raw Normal View History

2011-02-10 17:20:44 +00:00
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
2011-02-10 17:20:44 +00:00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\FrameworkBundle\Tests\Templating;
use Symfony\Bundle\FrameworkBundle\Tests\TestCase;
use Symfony\Bundle\FrameworkBundle\Templating\TemplateReference;
class TemplateTest extends TestCase
{
/**
* @dataProvider getTemplateToPathProvider
*/
2017-03-18 09:10:35 +00:00
public function testGetPathForTemplate($template, $path)
2011-02-10 17:20:44 +00:00
{
2017-03-18 09:10:35 +00:00
$this->assertSame($template->getPath(), $path);
2011-02-10 17:20:44 +00:00
}
public function getTemplateToPathProvider()
{
return array(
array(new TemplateReference('FooBundle', 'Post', 'index', 'html', 'php'), '@FooBundle/Resources/views/Post/index.html.php'),
array(new TemplateReference('FooBundle', '', 'index', 'html', 'twig'), '@FooBundle/Resources/views/index.html.twig'),
2011-02-10 17:20:44 +00:00
array(new TemplateReference('', 'Post', 'index', 'html', 'php'), 'views/Post/index.html.php'),
array(new TemplateReference('', '', 'index', 'html', 'php'), 'views/index.html.php'),
);
}
}