PHP 8.2.30
Preview: TemplateNameParserTest.php Size: 1.30 KB
/opt/cloudlinux/alt-php53/root/usr/share/pear/test/Templating/Symfony/Component/Templating/Tests/TemplateNameParserTest.php

<?php

/*
 * This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Templating\Tests;

use Symfony\Component\Templating\TemplateNameParser;
use Symfony\Component\Templating\TemplateReference;

class TemplateNameParserTest extends \PHPUnit_Framework_TestCase
{
    protected $parser;

    protected function setUp()
    {
        $this->parser = new TemplateNameParser();
    }

    protected function tearDown()
    {
        $this->parser = null;
    }

    /**
     * @dataProvider getLogicalNameToTemplateProvider
     */
    public function testParse($name, $ref)
    {
        $template = $this->parser->parse($name);

        $this->assertEquals($template->getLogicalName(), $ref->getLogicalName());
        $this->assertEquals($template->getLogicalName(), $name);
    }

    public function getLogicalNameToTemplateProvider()
    {
        return array(
            array('/path/to/section/name.engine', new TemplateReference('/path/to/section/name.engine', 'engine')),
            array('name.engine', new TemplateReference('name.engine', 'engine')),
            array('name', new TemplateReference('name')),
        );
    }
}

Directory Contents

Dirs: 4 × Files: 3

Name Size Perms Modified Actions
Fixtures DIR
- drwxr-xr-x 2024-03-03 22:55:08
Edit Download
Helper DIR
- drwxr-xr-x 2024-03-03 22:55:08
Edit Download
Loader DIR
- drwxr-xr-x 2024-03-03 22:55:08
Edit Download
Storage DIR
- drwxr-xr-x 2024-03-03 22:55:08
Edit Download
5.18 KB lrw-r--r-- 2019-12-18 11:20:42
Edit Download
8.84 KB lrw-r--r-- 2019-12-18 11:20:42
Edit Download
1.30 KB lrw-r--r-- 2019-12-18 11:20:42
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).