mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-09-02 09:32:43 +00:00
Adding an Acl property to AuthComponent and updating tests to use new API's
This commit is contained in:
parent
c6a63bae82
commit
f5bebc9306
2 changed files with 10 additions and 3 deletions
|
@ -254,6 +254,13 @@ class AuthComponent extends Component {
|
|||
*/
|
||||
public $params = array();
|
||||
|
||||
/**
|
||||
* AclComponent instance if using Acl + Auth
|
||||
*
|
||||
* @var AclComponent
|
||||
*/
|
||||
public $Acl;
|
||||
|
||||
/**
|
||||
* Method list for bound controller
|
||||
*
|
||||
|
|
|
@ -490,7 +490,7 @@ class AuthTest extends CakeTestCase {
|
|||
|
||||
$this->Controller = new AuthTestController();
|
||||
$this->Controller->Components->init($this->Controller);
|
||||
$this->Controller->Components->initialize($this->Controller);
|
||||
$this->Controller->Components->trigger('initialize', array(&$this->Controller));
|
||||
$this->Controller->beforeFilter();
|
||||
|
||||
ClassRegistry::addObject('view', new View($this->Controller));
|
||||
|
@ -800,7 +800,7 @@ class AuthTest extends CakeTestCase {
|
|||
$this->Controller->params['controller'] = 'auth_test';
|
||||
$this->Controller->params['action'] = 'add';
|
||||
|
||||
$this->Controller->Acl = $this->getMock('AclComponent');
|
||||
$this->Controller->Acl = $this->getMock('AclComponent', array(), array(), '', false);
|
||||
$this->Controller->Acl->expects($this->atLeastOnce())->method('check')->will($this->returnValue(true));
|
||||
|
||||
$this->Controller->Auth->initialize($this->Controller);
|
||||
|
@ -1552,7 +1552,7 @@ class AuthTest extends CakeTestCase {
|
|||
'Session'
|
||||
);
|
||||
$this->Controller->Components->init($this->Controller);
|
||||
$this->Controller->Components->initialize($this->Controller);
|
||||
$this->Controller->Components->trigger('initialize', array(&$this->Controller));
|
||||
Router::reload();
|
||||
|
||||
$this->AuthUserCustomField = new AuthUserCustomField();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue