From f5bebc9306a9050923a859f136c7be4e2dd13ee5 Mon Sep 17 00:00:00 2001 From: mark_story Date: Sat, 31 Jul 2010 15:41:28 -0400 Subject: [PATCH] Adding an Acl property to AuthComponent and updating tests to use new API's --- cake/libs/controller/components/auth.php | 7 +++++++ cake/tests/cases/libs/controller/components/auth.test.php | 6 +++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/cake/libs/controller/components/auth.php b/cake/libs/controller/components/auth.php index d1e1f10b013..e75280653e6 100644 --- a/cake/libs/controller/components/auth.php +++ b/cake/libs/controller/components/auth.php @@ -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 * diff --git a/cake/tests/cases/libs/controller/components/auth.test.php b/cake/tests/cases/libs/controller/components/auth.test.php index 6539af1bd74..aca6a41dc18 100644 --- a/cake/tests/cases/libs/controller/components/auth.test.php +++ b/cake/tests/cases/libs/controller/components/auth.test.php @@ -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)); @@ -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); @@ -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();