|
14 | 14 | use Symfony\Bundle\FrameworkBundle\Tests\TestCase;
|
15 | 15 | use Symfony\Bundle\FrameworkBundle\Templating\TemplateNameParser;
|
16 | 16 | use Symfony\Bundle\FrameworkBundle\Templating\TemplateReference;
|
| 17 | +use Symfony\Component\Templating\TemplateReference as BaseTemplateReference; |
17 | 18 |
|
18 | 19 | class TemplateNameParserTest extends TestCase
|
19 | 20 | {
|
@@ -63,25 +64,17 @@ public function getLogicalNameToTemplateProvider()
|
63 | 64 | array(':Post:index.html.php', new TemplateReference('', 'Post', 'index', 'html', 'php')),
|
64 | 65 | array('::index.html.php', new TemplateReference('', '', 'index', 'html', 'php')),
|
65 | 66 | array('FooBundle:Post:foo.bar.index.html.php', new TemplateReference('FooBundle', 'Post', 'foo.bar.index', 'html', 'php')),
|
| 67 | + array('/path/to/section/name.php', new BaseTemplateReference('/path/to/section/name.php', 'php')), |
| 68 | + array('name.twig', new BaseTemplateReference('name.twig', 'twig')), |
| 69 | + array('name', new BaseTemplateReference('name')), |
66 | 70 | );
|
67 | 71 | }
|
68 | 72 |
|
69 | 73 | /**
|
70 |
| - * @dataProvider getInvalidLogicalNameProvider |
71 | 74 | * @expectedException \InvalidArgumentException
|
72 | 75 | */
|
73 |
| - public function testParseInvalidName($name) |
| 76 | + public function testParseValidNameWithNotFoundBundle() |
74 | 77 | {
|
75 |
| - $this->parser->parse($name); |
76 |
| - } |
77 |
| - |
78 |
| - public function getInvalidLogicalNameProvider() |
79 |
| - { |
80 |
| - return array( |
81 |
| - array('BarBundle:Post:index.html.php'), |
82 |
| - array('FooBundle:Post:index'), |
83 |
| - array('FooBundle:Post'), |
84 |
| - array('FooBundle:Post:foo:bar'), |
85 |
| - ); |
| 78 | + $this->parser->parse('BarBundle:Post:index.html.php'); |
86 | 79 | }
|
87 | 80 | }
|
0 commit comments