@@ -43,30 +43,31 @@ protected function tearDown()
4343 }
4444
4545 /**
46- * @dataProvider getLogicalNameToTemplateProvider
46+ * @dataProvider parseProvider
4747 */
48- public function testParse ($ name , $ ref )
48+ public function testParse ($ name , $ logicalName , $ path , $ ref )
4949 {
5050 $ template = $ this ->parser ->parse ($ name );
5151
52- $ this ->assertEquals ($ template ->getLogicalName (), $ ref ->getLogicalName ());
53- $ this ->assertEquals ($ template ->getLogicalName (), $ name );
52+ $ this ->assertSame ($ ref ->getLogicalName (), $ template ->getLogicalName ());
53+ $ this ->assertSame ($ logicalName , $ template ->getLogicalName ());
54+ $ this ->assertSame ($ path , $ template ->getPath ());
5455 }
5556
56- public function getLogicalNameToTemplateProvider ()
57+ public function parseProvider ()
5758 {
5859 return array (
59- array ('FooBundle:Post:index.html.php ' , new TemplateReference ('FooBundle ' , 'Post ' , 'index ' , 'html ' , 'php ' )),
60- array ('FooBundle:Post:index.html.twig ' , new TemplateReference ('FooBundle ' , 'Post ' , 'index ' , 'html ' , 'twig ' )),
61- array ('FooBundle:Post:index.xml.php ' , new TemplateReference ('FooBundle ' , 'Post ' , 'index ' , 'xml ' , 'php ' )),
62- array ('SensioFooBundle:Post:index.html.php ' , new TemplateReference ('SensioFooBundle ' , 'Post ' , 'index ' , 'html ' , 'php ' )),
63- array ('SensioCmsFooBundle:Post:index.html.php ' , new TemplateReference ('SensioCmsFooBundle ' , 'Post ' , 'index ' , 'html ' , 'php ' )),
64- array (':Post:index.html.php ' , new TemplateReference ('' , 'Post ' , 'index ' , 'html ' , 'php ' )),
65- array ('::index.html.php ' , new TemplateReference ('' , '' , 'index ' , 'html ' , 'php ' )),
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 ' )),
60+ array ('FooBundle:Post:index.html.php ' , ' FooBundle:Post:index.html.php ' , ' @FooBundle/Resources/views/Post/index.html.php ' , new TemplateReference ('FooBundle ' , 'Post ' , 'index ' , 'html ' , 'php ' )),
61+ array ('FooBundle:Post:index.html.twig ' , ' FooBundle:Post:index.html.twig ' , ' @FooBundle/Resources/views/Post/index.html.twig ' , new TemplateReference ('FooBundle ' , 'Post ' , 'index ' , 'html ' , 'twig ' )),
62+ array ('FooBundle:Post:index.xml.php ' , ' FooBundle:Post:index.xml.php ' , ' @FooBundle/Resources/views/Post/index.xml.php ' , new TemplateReference ('FooBundle ' , 'Post ' , 'index ' , 'xml ' , 'php ' )),
63+ array ('SensioFooBundle:Post:index.html.php ' , ' SensioFooBundle:Post:index.html.php ' , ' @SensioFooBundle/Resources/views/Post/index.html.php ' , new TemplateReference ('SensioFooBundle ' , 'Post ' , 'index ' , 'html ' , 'php ' )),
64+ array ('SensioCmsFooBundle:Post:index.html.php ' , ' SensioCmsFooBundle:Post:index.html.php ' , ' @SensioCmsFooBundle/Resources/views/Post/index.html.php ' , new TemplateReference ('SensioCmsFooBundle ' , 'Post ' , 'index ' , 'html ' , 'php ' )),
65+ array (':Post:index.html.php ' , ' :Post:index.html.php ' , ' views/Post/index.html.php ' , new TemplateReference ('' , 'Post ' , 'index ' , 'html ' , 'php ' )),
66+ array ('::index.html.php ' , ' ::index.html.php ' , ' views/index.html.php ' , new TemplateReference ('' , '' , 'index ' , 'html ' , 'php ' )),
67+ array ('FooBundle:Post:foo.bar.index.html.php ' , ' FooBundle:Post:foo.bar.index.html.php ' , ' @FooBundle/Resources/views/Post/foo.bar.index.html.php ' , new TemplateReference ('FooBundle ' , 'Post ' , 'foo.bar.index ' , 'html ' , 'php ' )),
68+ array ('/path/to/section/name.php ' , ' /path/to/section/name.php ' , ' /path/to/section/name.php ' , new BaseTemplateReference ('/path/to/section/name.php ' , 'php ' )),
69+ array ('name.twig ' , ' name.twig ' , ' name.twig ' , new BaseTemplateReference ('name.twig ' , 'twig ' )),
70+ array ('name ' , ' name ' , ' name ' , new BaseTemplateReference ('name ' )),
7071 );
7172 }
7273
0 commit comments