Skip to content
Permalink
Browse files

Updating AclComponent to new Component API.

  • Loading branch information...
markstory committed Jul 4, 2010
1 parent efc5054 commit 7b4916e16a9637a3e9602ac3950278fe35abd2a0
Showing with 22 additions and 15 deletions.
  1. +14 −0 cake/libs/controller/components/acl.php
  2. +8 −15 cake/tests/cases/libs/controller/components/acl.test.php
@@ -41,6 +41,20 @@ class AclComponent extends Component {
*/
protected $_Instance = null;
/**
* Aro object.
*
* @var string
*/
public $Aro;
/**
* Aco object
*
* @var string
*/
public $Aco;
/**
* Constructor. Will return an instance of the correct ACL class as defined in `Configure::read('Acl.classname')`
*
@@ -199,7 +199,8 @@ function setUp() {
$this->getMock('AclInterface', array(), array(), 'MockAclImplementation');
}
Configure::write('Acl.classname', 'MockAclImplementation');
$this->Acl = new AclComponent();
$Collection = new ComponentCollection();
$this->Acl = new AclComponent($Collection);
}
/**
@@ -216,12 +217,13 @@ function tearDown() {
* test that construtor throws an exception when Acl.classname is a
* non-existant class
*
* @expectedException Exception
* @return void
*/
function testConstrutorException() {
$this->expectException();
Configure::write('Acl.classname', 'AclClassNameThatDoesNotExist');
$acl = new AclComponent();
$Collection = new ComponentCollection();
$acl = new AclComponent($Collection);
}
/**
@@ -240,24 +242,14 @@ function testAdapter() {
/**
* test that adapter() whines when the class is not an AclBase
*
* @expectedException Exception
* @return void
*/
function testAdapterException() {
$this->expectException();
$thing = new StdClass();
$this->Acl->adapter($thing);
}
/**
* testStartup method
*
* @access public
* @return void
*/
function testStartup() {
$controller = new Controller();
$this->assertTrue($this->Acl->startup($controller));
}
}
/**
@@ -365,7 +357,8 @@ function startTest() {
Configure::write('Acl.classname', 'DbAclTwoTest');
Configure::write('Acl.database', 'test_suite');
$this->Acl = new AclComponent();
$Collection = new ComponentCollection();
$this->Acl = new AclComponent($Collection);
}
/**

0 comments on commit 7b4916e

Please sign in to comment.
You can’t perform that action at this time.