[+BUGFIX] Fluid (TemplateParser): The View Helper name is now resolved correctly...
authorJochen Rau <j.rau@web.de>
Fri, 14 Aug 2009 08:54:47 +0000 (08:54 +0000)
committerJochen Rau <j.rau@web.de>
Fri, 14 Aug 2009 08:54:47 +0000 (08:54 +0000)
typo3/sysext/fluid/Classes/Core/Parser/TemplateParser.php
typo3/sysext/fluid/Tests/Core/TemplateParserTest_testcase.php

index ccdc2a5..ae11cb6 100644 (file)
@@ -423,9 +423,7 @@ class Tx_Fluid_Core_Parser_TemplateParser {
                $explodedViewHelperName = explode('.', $methodIdentifier);
                $className = '';
                if (count($explodedViewHelperName) > 1) {
-                       $className = ucfirst($explodedViewHelperName[0]);
-                       $className .= Tx_Fluid_Fluid::NAMESPACE_SEPARATOR;
-                       $className .= ucfirst($explodedViewHelperName[1]);
+                       $className = implode(Tx_Fluid_Fluid::NAMESPACE_SEPARATOR, array_map('ucfirst', $explodedViewHelperName));
                } else {
                        $className = ucfirst($explodedViewHelperName[0]);
                }
index d9a608b..631f377 100644 (file)
@@ -75,6 +75,17 @@ class Tx_Fluid_Core_TemplateParserTest_testcase extends Tx_Extbase_Base_testcase
 
        /**
         * @test
+        * @author Jochen Rau <jochen.rau@typoplanet.de>
+        */
+       public function viewHelperNameCanBeResolved() {
+               $mockTemplateParser = $this->getMock($this->buildAccessibleProxy('Tx_Fluid_Core_Parser_TemplateParser'), array('dummy'), array(), '', FALSE);
+               $result = $mockTemplateParser->_call('resolveViewHelperName', 'f', 'foo.bar.baz');
+               $expected = 'Tx_Fluid_ViewHelpers_Foo_Bar_BazViewHelper';
+               $this->assertEquals($result, $expected, 'The name of the View Helper Name could not be resolved.');
+       }
+
+       /**
+        * @test
         * @author Sebastian Kurf├╝rst <sebastian@typo3.org>
         * @expectedException Tx_Fluid_Core_Parser_Exception
         */