From ff889c2c8ec1a22ee40efa6f22810fdc04c7dc05 Mon Sep 17 00:00:00 2001 From: mark_story Date: Sun, 9 Jan 2011 00:33:06 -0500 Subject: [PATCH] Renaming method names, no need to include Objects, its implied. --- cake/libs/controller/components/auth.php | 10 +++++----- .../libs/controller/components/auth.test.php | 18 +++++++++--------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/cake/libs/controller/components/auth.php b/cake/libs/controller/components/auth.php index 6feac21ec..4aed7f015 100644 --- a/cake/libs/controller/components/auth.php +++ b/cake/libs/controller/components/auth.php @@ -433,7 +433,7 @@ class AuthComponent extends Component { $request = $this->request; } if (empty($this->_authorizeObjects)) { - $this->loadAuthorizeObjects(); + $this->constructAuthorize(); } foreach ($this->_authorizeObjects as $authorizer) { if ($authorizer->authorize($user, $request) === true) { @@ -448,7 +448,7 @@ class AuthComponent extends Component { * * @return mixed Either null when authorize is empty, or the loaded authorization objects. */ - public function loadAuthorizeObjects() { + public function constructAuthorize() { if (empty($this->authorize)) { return; } @@ -528,7 +528,7 @@ class AuthComponent extends Component { */ public function mapActions($map = array()) { if (empty($this->_authorizeObjects)) { - $this->loadAuthorizeObjects(); + $this->constructAuthorize(); } foreach ($this->_authorizeObjects as $auth) { $auth->mapActions($map); @@ -694,7 +694,7 @@ class AuthComponent extends Component { */ public function identify(CakeRequest $request) { if (empty($this->_authenticateObjects)) { - $this->loadAuthenticateObjects(); + $this->constructAuthenticate(); } foreach ($this->_authenticateObjects as $auth) { $result = $auth->authenticate($request); @@ -710,7 +710,7 @@ class AuthComponent extends Component { * * @return mixed either null on empty authenticate value, or an array of loaded objects. */ - public function loadAuthenticateObjects() { + public function constructAuthenticate() { if (empty($this->authenticate)) { return; } diff --git a/cake/tests/cases/libs/controller/components/auth.test.php b/cake/tests/cases/libs/controller/components/auth.test.php index 9db1ac1ca..600b08e20 100644 --- a/cake/tests/cases/libs/controller/components/auth.test.php +++ b/cake/tests/cases/libs/controller/components/auth.test.php @@ -730,7 +730,7 @@ class AuthTest extends CakeTestCase { 'AuthMockTwo', 'AuthMockThree' ); - $mocks = $this->Controller->Auth->loadAuthorizeObjects(); + $mocks = $this->Controller->Auth->constructAuthorize(); $request = $this->Controller->request; $this->assertEquals(3, count($mocks)); @@ -759,10 +759,10 @@ class AuthTest extends CakeTestCase { $this->Controller->Auth->authorize = array( 'Controller' ); - $result = $this->Controller->Auth->loadAuthorizeObjects(); + $result = $this->Controller->Auth->constructAuthorize(); $this->assertEquals(1, count($result)); - $result = $this->Controller->Auth->loadAuthorizeObjects(); + $result = $this->Controller->Auth->constructAuthorize(); $this->assertEquals(1, count($result)); } @@ -784,7 +784,7 @@ class AuthTest extends CakeTestCase { $this->Controller->Auth->actionPath = 'controllers/'; $this->Controller->Auth->authorize = array('Actions'); - $objects = $this->Controller->Auth->loadAuthorizeObjects(); + $objects = $this->Controller->Auth->constructAuthorize(); $result = $objects[0]; $this->assertEquals($result->settings['actionPath'], 'controllers/'); } @@ -798,10 +798,10 @@ class AuthTest extends CakeTestCase { $this->Controller->Auth->authenticate = array( 'Form' ); - $result = $this->Controller->Auth->loadAuthenticateObjects(); + $result = $this->Controller->Auth->constructAuthenticate(); $this->assertEquals(1, count($result)); - $result = $this->Controller->Auth->loadAuthenticateObjects(); + $result = $this->Controller->Auth->constructAuthenticate(); $this->assertEquals(1, count($result)); } @@ -816,7 +816,7 @@ class AuthTest extends CakeTestCase { $this->Controller->Auth->fields = array('username' => 'user', 'password' => 'passwd'); $this->Controller->Auth->authenticate = array('Form'); - $objects = $this->Controller->Auth->loadAuthenticateObjects(); + $objects = $this->Controller->Auth->constructAuthenticate(); $result = $objects[0]; $this->assertEquals($result->settings['userModel'], 'AuthUser'); } @@ -1474,7 +1474,7 @@ class AuthTest extends CakeTestCase { function testMapActionsDelegation() { $this->getMock('BaseAuthorize', array('authorize'), array(), 'MapActionMockAuthorize', false); $this->Controller->Auth->authorize = array('MapActionMock'); - $mock = $this->Controller->Auth->loadAuthorizeObjects(); + $mock = $this->Controller->Auth->constructAuthorize(); $mock[0]->expects($this->once()) ->method('mapActions') ->with(array('create' => array('my_action'))); @@ -1494,7 +1494,7 @@ class AuthTest extends CakeTestCase { $this->Controller->Auth->request = $request; $this->Controller->Auth->authenticate = array('RequestLoginMock'); - $mock = $this->Controller->Auth->loadAuthenticateObjects(); + $mock = $this->Controller->Auth->constructAuthenticate(); $mock[0]->expects($this->once()) ->method('authenticate') ->with($request)