mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 17:16:18 +00:00
Renaming method names, no need to include Objects, its implied.
This commit is contained in:
parent
1696df7201
commit
ff889c2c8e
2 changed files with 14 additions and 14 deletions
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue