@@ -43,30 +43,31 @@ protected function tearDown()
43
43
}
44
44
45
45
/**
46
- * @dataProvider getLogicalNameToTemplateProvider
46
+ * @dataProvider parseProvider
47
47
*/
48
- public function testParse ($ name , $ ref )
48
+ public function testParse ($ name , $ logicalName , $ path , $ ref )
49
49
{
50
50
$ template = $ this ->parser ->parse ($ name );
51
51
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 ());
54
55
}
55
56
56
- public function getLogicalNameToTemplateProvider ()
57
+ public function parseProvider ()
57
58
{
58
59
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 ' )),
70
71
);
71
72
}
72
73
0 commit comments