Skip to content
Permalink
Browse files

Minor refactor to remove method calls to Inflector::camelize.

Adding tests to ensure references are maintained.
  • Loading branch information...
markstory committed Sep 3, 2009
1 parent 7569534 commit 2ff53343471f8e07db04c2282653e72b29acae45
Showing with 9 additions and 18 deletions.
  1. +4 −11 cake/libs/view/view.php
  2. +5 −7 cake/tests/cases/libs/view/view.test.php
@@ -1,26 +1,21 @@
<?php
/* SVN FILE: $Id$ */
/**
* Methods for displaying presentation data in the view.
*
* PHP versions 4 and 5
*
* CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org)
* Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @filesource
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
* @package cake
* @subpackage cake.cake.libs.view
* @since CakePHP(tm) v 0.10.0.1076
* @version $Revision$
* @modifiedby $LastChangedBy$
* @lastmodified $Date$
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
@@ -699,10 +694,8 @@ function _render($___viewFn, $___dataForView, $loadHelpers = true, $cached = fal
$name = $helperNames[$i];
${$name} =& $loadedHelpers[$helpers[$i]];
$this->loaded[$name] =& ${$name};
$memberName = Inflector::camelize($name);
$this->{$memberName} =& ${$name};
$this->loaded[$helperNames[$i]] =& ${$name};
$this->{$helpers[$i]} =& ${$name};
}
$this->_triggerHelpers('beforeRender');
}
@@ -1,6 +1,4 @@
<?php
/* SVN FILE: $Id$ */
/**
* ViewTest file
*
@@ -9,20 +7,17 @@
* PHP versions 4 and 5
*
* CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
* Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
*
* Licensed under The Open Group Test Suite License
* Redistributions of files must retain the above copyright notice.
*
* @filesource
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
* @package cake
* @subpackage cake.tests.cases.libs
* @since CakePHP(tm) v 1.2.0.4206
* @version $Revision$
* @modifiedby $LastChangedBy$
* @lastmodified $Date$
* @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License
*/
App::import('Core', array('View', 'Controller'));
@@ -658,6 +653,9 @@ function testRenderLoadHelper() {
$this->assertTrue(is_object($View->Form));
$this->assertTrue(is_object($View->Form->Html));
$this->assertTrue(is_object($View->PluggedHelper->OtherHelper));
$this->assertReference($View->Form, $View->loaded['form']);
$this->assertReference($View->Html, $View->loaded['html']);
$this->assertReference($View->PluggedHelper->OtherHelper, $View->loaded['otherHelper']);
}
/**

0 comments on commit 2ff5334

Please sign in to comment.
You can’t perform that action at this time.