Changeset 18955
- Timestamp:
- 06/05/09 12:27:40 (4 years ago)
- Files:
-
- branches/1.2/lib/helper/PartialHelper.php (modified) (3 diffs)
- branches/1.2/test/unit/helper/PartialHelperTest.php (modified) (2 diffs)
- branches/1.3/lib/helper/PartialHelper.php (modified) (2 diffs)
- branches/1.3/test/unit/helper/PartialHelperTest.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.2/lib/helper/PartialHelper.php
r13463 r18955 3 3 /* 4 4 * This file is part of the symfony package. 5 * (c) 2004-2006Fabien Potencier <fabien.potencier@symfony-project.com>5 * (c) Fabien Potencier <fabien.potencier@symfony-project.com> 6 6 * 7 7 * For the full copyright and license information, please view the LICENSE … … 137 137 $actionName = '_'.$componentName; 138 138 139 $class = sfConfig::get('mod_'. $moduleName.'_partial_view_class', 'sf').'PartialView';139 $class = sfConfig::get('mod_'.strtolower($moduleName).'_partial_view_class', 'sf').'PartialView'; 140 140 $view = new $class($context, $moduleName, $actionName, ''); 141 141 $view->setPartialVars($vars); … … 212 212 $actionName = '_'.$templateName; 213 213 214 $class = sfConfig::get('mod_'. $moduleName.'_partial_view_class', 'sf').'PartialView';214 $class = sfConfig::get('mod_'.strtolower($moduleName).'_partial_view_class', 'sf').'PartialView'; 215 215 $view = new $class($context, $moduleName, $actionName, ''); 216 216 $view->setPartialVars($vars); branches/1.2/test/unit/helper/PartialHelperTest.php
r11482 r18955 3 3 /* 4 4 * This file is part of the symfony package. 5 * (c) 2004-2006Fabien Potencier <fabien.potencier@symfony-project.com>5 * (c) Fabien Potencier <fabien.potencier@symfony-project.com> 6 6 * 7 7 * For the full copyright and license information, please view the LICENSE … … 15 15 // Fixme: make this test more beautiful and extend it 16 16 17 $t = new lime_test( 1, new lime_output_color());17 $t = new lime_test(2, new lime_output_color()); 18 18 19 19 class MyTestPartialView extends sfPartialView 20 20 { 21 22 21 public function render() 23 22 { 24 //used to check if this class was used 25 return 'MyPartialView'; 23 return '==RENDERED=='; 26 24 } 25 27 26 public function initialize($context, $moduleName, $actionName, $viewName) 28 27 { 29 //basic dummy so far30 28 } 29 31 30 public function setPartialVars(array $partialVars) 32 31 { 33 //basic dummy so far34 32 } 35 36 33 } 37 34 38 $t->diag('->get_partial()'); 39 sfConfig::set('mod_MODULE_partial_view_class', 'MyTest'); 40 $t->is(get_partial('MODULE/dummy'), 'MyPartialView', 'get_partial() uses the class specified in partial_view_class for the given module'); 35 $t->diag('get_partial()'); 36 sfConfig::set('mod_module_partial_view_class', 'MyTest'); 41 37 38 $t->is(get_partial('module/dummy'), '==RENDERED==', 'get_partial() uses the class specified in partial_view_class for the given module'); 39 $t->is(get_partial('MODULE/dummy'), '==RENDERED==', 'get_partial() accepts a case-insensitive module name'); branches/1.3/lib/helper/PartialHelper.php
r13463 r18955 137 137 $actionName = '_'.$componentName; 138 138 139 $class = sfConfig::get('mod_'. $moduleName.'_partial_view_class', 'sf').'PartialView';139 $class = sfConfig::get('mod_'.strtolower($moduleName).'_partial_view_class', 'sf').'PartialView'; 140 140 $view = new $class($context, $moduleName, $actionName, ''); 141 141 $view->setPartialVars($vars); … … 212 212 $actionName = '_'.$templateName; 213 213 214 $class = sfConfig::get('mod_'. $moduleName.'_partial_view_class', 'sf').'PartialView';214 $class = sfConfig::get('mod_'.strtolower($moduleName).'_partial_view_class', 'sf').'PartialView'; 215 215 $view = new $class($context, $moduleName, $actionName, ''); 216 216 $view->setPartialVars($vars); branches/1.3/test/unit/helper/PartialHelperTest.php
r11482 r18955 3 3 /* 4 4 * This file is part of the symfony package. 5 * (c) 2004-2006Fabien Potencier <fabien.potencier@symfony-project.com>5 * (c) Fabien Potencier <fabien.potencier@symfony-project.com> 6 6 * 7 7 * For the full copyright and license information, please view the LICENSE … … 15 15 // Fixme: make this test more beautiful and extend it 16 16 17 $t = new lime_test( 1, new lime_output_color());17 $t = new lime_test(2, new lime_output_color()); 18 18 19 19 class MyTestPartialView extends sfPartialView 20 20 { 21 22 21 public function render() 23 22 { 24 //used to check if this class was used 25 return 'MyPartialView'; 23 return '==RENDERED=='; 26 24 } 25 27 26 public function initialize($context, $moduleName, $actionName, $viewName) 28 27 { 29 //basic dummy so far30 28 } 29 31 30 public function setPartialVars(array $partialVars) 32 31 { 33 //basic dummy so far34 32 } 35 36 33 } 37 34 38 $t->diag('->get_partial()'); 39 sfConfig::set('mod_MODULE_partial_view_class', 'MyTest'); 40 $t->is(get_partial('MODULE/dummy'), 'MyPartialView', 'get_partial() uses the class specified in partial_view_class for the given module'); 35 $t->diag('get_partial()'); 36 sfConfig::set('mod_module_partial_view_class', 'MyTest'); 41 37 38 $t->is(get_partial('module/dummy'), '==RENDERED==', 'get_partial() uses the class specified in partial_view_class for the given module'); 39 $t->is(get_partial('MODULE/dummy'), '==RENDERED==', 'get_partial() accepts a case-insensitive module name');