@@ -44,25 +44,37 @@ protected function tearDown()
44
44
/**
45
45
* @dataProvider getLogicalNameToTemplateProvider
46
46
*/
47
- public function testParse ( $ name , $ ref )
47
+ public function testParseLogicalName ( $ logicalName , $ atName , $ ref )
48
48
{
49
- $ template = $ this ->parser ->parse ($ name );
49
+ $ template = $ this ->parser ->parse ($ logicalName );
50
50
51
- $ this ->assertEquals ($ template ->getLogicalName (), $ ref ->getLogicalName ());
52
- $ this ->assertEquals ($ template ->getLogicalName (), $ name );
51
+ $ this ->assertEquals ($ logicalName , $ template ->getLogicalName ());
52
+ $ this ->assertEquals ($ logicalName , $ ref ->getLogicalName ());
53
+ }
54
+
55
+ /**
56
+ * @dataProvider getLogicalNameToTemplateProvider
57
+ */
58
+ public function testParseAtName ($ logicalName , $ atName , $ ref )
59
+ {
60
+ $ template = $ this ->parser ->parse ($ atName );
61
+
62
+ $ this ->assertEquals ($ logicalName , $ template ->getLogicalName ());
63
+ $ this ->assertEquals ($ logicalName , $ ref ->getLogicalName ());
53
64
}
54
65
55
66
public function getLogicalNameToTemplateProvider ()
56
67
{
57
68
return array (
58
- array ('FooBundle:Post:index.html.php ' , new TemplateReference ('FooBundle ' , 'Post ' , 'index ' , 'html ' , 'php ' )),
59
- array ('FooBundle:Post:index.html.twig ' , new TemplateReference ('FooBundle ' , 'Post ' , 'index ' , 'html ' , 'twig ' )),
60
- array ('FooBundle:Post:index.xml.php ' , new TemplateReference ('FooBundle ' , 'Post ' , 'index ' , 'xml ' , 'php ' )),
61
- array ('SensioFooBundle:Post:index.html.php ' , new TemplateReference ('SensioFooBundle ' , 'Post ' , 'index ' , 'html ' , 'php ' )),
62
- array ('SensioCmsFooBundle:Post:index.html.php ' , new TemplateReference ('SensioCmsFooBundle ' , 'Post ' , 'index ' , 'html ' , 'php ' )),
63
- array (':Post:index.html.php ' , new TemplateReference ('' , 'Post ' , 'index ' , 'html ' , 'php ' )),
64
- array ('::index.html.php ' , new TemplateReference ('' , '' , 'index ' , 'html ' , 'php ' )),
65
- array ('FooBundle:Post:foo.bar.index.html.php ' , new TemplateReference ('FooBundle ' , 'Post ' , 'foo.bar.index ' , 'html ' , 'php ' )),
69
+ array ('FooBundle:Post:index.html.php ' , '@Foo/Post/index.html.php ' , new TemplateReference ('FooBundle ' , 'Post ' , 'index ' , 'html ' , 'php ' )),
70
+ array ('FooBundle:Post:index.html.twig ' , '@Foo/Post/index.html.twig ' , new TemplateReference ('FooBundle ' , 'Post ' , 'index ' , 'html ' , 'twig ' )),
71
+ array ('FooBundle:Post:index.xml.php ' , '@Foo/Post/index.xml.php ' , new TemplateReference ('FooBundle ' , 'Post ' , 'index ' , 'xml ' , 'php ' )),
72
+ array ('SensioFooBundle:Post:index.html.php ' , '@SensioFoo/Post/index.html.php ' , new TemplateReference ('SensioFooBundle ' , 'Post ' , 'index ' , 'html ' , 'php ' )),
73
+ array ('SensioCmsFooBundle:Post:index.html.php ' , '@SensioCmsFoo/Post/index.html.php ' , new TemplateReference ('SensioCmsFooBundle ' , 'Post ' , 'index ' , 'html ' , 'php ' )),
74
+ array ('FooBundle::index.html.php ' , '@Foo/index.html.php ' , new TemplateReference ('FooBundle ' , '' , 'index ' , 'html ' , 'php ' )),
75
+ array (':Post:index.html.php ' , 'Post/index.html.php ' , new TemplateReference ('' , 'Post ' , 'index ' , 'html ' , 'php ' )),
76
+ array ('::index.html.php ' , 'index.html.php ' , new TemplateReference ('' , '' , 'index ' , 'html ' , 'php ' )),
77
+ array ('FooBundle:Post:foo.bar.index.html.php ' , '@Foo/Post/foo.bar.index.html.php ' , new TemplateReference ('FooBundle ' , 'Post ' , 'foo.bar.index ' , 'html ' , 'php ' )),
66
78
);
67
79
}
68
80
0 commit comments