Skip to content

Commit

Permalink
Adding an Acl property to AuthComponent and updating tests to use new…
Browse files Browse the repository at this point in the history
… API's
  • Loading branch information
markstory committed Aug 11, 2010
1 parent c6a63ba commit f5bebc9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
7 changes: 7 additions & 0 deletions cake/libs/controller/components/auth.php
Expand Up @@ -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
*
Expand Down
6 changes: 3 additions & 3 deletions cake/tests/cases/libs/controller/components/auth.test.php
Expand Up @@ -490,7 +490,7 @@ function setUp() {

$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));
Expand Down Expand Up @@ -800,7 +800,7 @@ function testAuthorizeActions() {
$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);
Expand Down Expand Up @@ -1552,7 +1552,7 @@ function testComponentSettings() {
'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();
Expand Down

0 comments on commit f5bebc9

Please sign in to comment.