Development

Changeset 18955

You must first sign up to be able to contribute.

Changeset 18955

Show
Ignore:
Timestamp:
06/05/09 12:27:40 (4 years ago)
Author:
Kris.Wallsmith
Message:

[1.2, 1.3] fixed case insensitivity of module name when checking module.yml for a partial view class

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.2/lib/helper/PartialHelper.php

    r13463 r18955  
    33/* 
    44 * This file is part of the symfony package. 
    5  * (c) 2004-2006 Fabien Potencier <fabien.potencier@symfony-project.com> 
     5 * (c) Fabien Potencier <fabien.potencier@symfony-project.com> 
    66 * 
    77 * For the full copyright and license information, please view the LICENSE 
     
    137137  $actionName = '_'.$componentName; 
    138138 
    139   $class = sfConfig::get('mod_'.$moduleName.'_partial_view_class', 'sf').'PartialView'; 
     139  $class = sfConfig::get('mod_'.strtolower($moduleName).'_partial_view_class', 'sf').'PartialView'; 
    140140  $view = new $class($context, $moduleName, $actionName, ''); 
    141141  $view->setPartialVars($vars); 
     
    212212  $actionName = '_'.$templateName; 
    213213 
    214   $class = sfConfig::get('mod_'.$moduleName.'_partial_view_class', 'sf').'PartialView'; 
     214  $class = sfConfig::get('mod_'.strtolower($moduleName).'_partial_view_class', 'sf').'PartialView'; 
    215215  $view = new $class($context, $moduleName, $actionName, ''); 
    216216  $view->setPartialVars($vars); 
  • branches/1.2/test/unit/helper/PartialHelperTest.php

    r11482 r18955  
    33/* 
    44 * This file is part of the symfony package. 
    5  * (c) 2004-2006 Fabien Potencier <fabien.potencier@symfony-project.com> 
     5 * (c) Fabien Potencier <fabien.potencier@symfony-project.com> 
    66 *  
    77 * For the full copyright and license information, please view the LICENSE 
     
    1515// Fixme: make this test more beautiful and extend it 
    1616 
    17 $t = new lime_test(1, new lime_output_color()); 
     17$t = new lime_test(2, new lime_output_color()); 
    1818 
    1919class MyTestPartialView extends sfPartialView 
    2020{ 
    21  
    2221  public function render() 
    2322  { 
    24     //used to check if this class was used 
    25     return 'MyPartialView'; 
     23    return '==RENDERED=='; 
    2624  } 
     25 
    2726  public function initialize($context, $moduleName, $actionName, $viewName) 
    2827  { 
    29     //basic dummy so far 
    3028  } 
     29 
    3130  public function setPartialVars(array $partialVars) 
    3231  { 
    33     //basic dummy so far 
    3432  } 
    35  
    3633} 
    3734 
    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()'); 
     36sfConfig::set('mod_module_partial_view_class', 'MyTest'); 
    4137 
     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  
    137137  $actionName = '_'.$componentName; 
    138138 
    139   $class = sfConfig::get('mod_'.$moduleName.'_partial_view_class', 'sf').'PartialView'; 
     139  $class = sfConfig::get('mod_'.strtolower($moduleName).'_partial_view_class', 'sf').'PartialView'; 
    140140  $view = new $class($context, $moduleName, $actionName, ''); 
    141141  $view->setPartialVars($vars); 
     
    212212  $actionName = '_'.$templateName; 
    213213 
    214   $class = sfConfig::get('mod_'.$moduleName.'_partial_view_class', 'sf').'PartialView'; 
     214  $class = sfConfig::get('mod_'.strtolower($moduleName).'_partial_view_class', 'sf').'PartialView'; 
    215215  $view = new $class($context, $moduleName, $actionName, ''); 
    216216  $view->setPartialVars($vars); 
  • branches/1.3/test/unit/helper/PartialHelperTest.php

    r11482 r18955  
    33/* 
    44 * This file is part of the symfony package. 
    5  * (c) 2004-2006 Fabien Potencier <fabien.potencier@symfony-project.com> 
     5 * (c) Fabien Potencier <fabien.potencier@symfony-project.com> 
    66 *  
    77 * For the full copyright and license information, please view the LICENSE 
     
    1515// Fixme: make this test more beautiful and extend it 
    1616 
    17 $t = new lime_test(1, new lime_output_color()); 
     17$t = new lime_test(2, new lime_output_color()); 
    1818 
    1919class MyTestPartialView extends sfPartialView 
    2020{ 
    21  
    2221  public function render() 
    2322  { 
    24     //used to check if this class was used 
    25     return 'MyPartialView'; 
     23    return '==RENDERED=='; 
    2624  } 
     25 
    2726  public function initialize($context, $moduleName, $actionName, $viewName) 
    2827  { 
    29     //basic dummy so far 
    3028  } 
     29 
    3130  public function setPartialVars(array $partialVars) 
    3231  { 
    33     //basic dummy so far 
    3432  } 
    35  
    3633} 
    3734 
    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()'); 
     36sfConfig::set('mod_module_partial_view_class', 'MyTest'); 
    4137 
     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');