Skip to content

Commit

Permalink
Fix PhpAcl tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Oct 3, 2012
1 parent 883cc83 commit a38cac8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 16 deletions.
10 changes: 3 additions & 7 deletions lib/Cake/Controller/Component/Acl/PhpAcl.php
@@ -1,9 +1,5 @@
<?php
/**
* PHP configuration based AclInterface implementation
*
* PHP 5
*
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
*
Expand All @@ -12,16 +8,16 @@
*
* @copyright Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package Cake.Controller.Component.Acl
* @since CakePHP(tm) v 2.1
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/

namespace Cake\Controller\Component\Acl;

use Cake\Configure\PhpReader;
use Cake\Controller\Component;
use Cake\Core\Object;
use Cake\Error;
use Cake\Utility\Hash;
use Cake\Utility\Inflector;

/**
Expand Down Expand Up @@ -93,7 +89,7 @@ public function initialize(Component $Component) {
*
* @param array $config configuration array, see docs
* @return void
* @throws AclException When required keys are missing.
* @throws Cake\Error\Exception When required keys are missing.
*/
public function build(array $config) {
if (empty($config['roles'])) {
Expand Down
3 changes: 2 additions & 1 deletion lib/Cake/Controller/Component/AclComponent.php
Expand Up @@ -13,6 +13,7 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
namespace Cake\Controller\Component;

use Cake\Configure\IniReader;
use Cake\Controller\Component;
use Cake\Controller\ComponentCollection;
Expand Down Expand Up @@ -68,7 +69,7 @@ public function __construct(ComponentCollection $collection, $settings = array()
parent::__construct($collection, $settings);
$classname = $name = Configure::read('Acl.classname');
if (!class_exists($classname)) {
$classname = App::classname($name, 'Controller/Component', 'Component');
$classname = App::classname($name, 'Controller/Component/Acl');
if (!$classname) {
throw new Error\Exception(__d('cake_dev', 'Could not find %s.', $name));
}
Expand Down
11 changes: 3 additions & 8 deletions lib/Cake/Test/TestCase/Controller/Component/Acl/PhpAclTest.php
@@ -1,9 +1,5 @@
<?php
/**
* PhpAclTest file.
*
* PHP 5
*
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
*
Expand All @@ -12,12 +8,11 @@
*
* @copyright Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package Cake.Test.Case.Controller.Component.Acl
* @since CakePHP(tm) v 2.1
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/

namespace Cake\Test\TestCase\Controller\Component;

use Cake\Controller\ComponentCollection;
use Cake\Controller\Component\AclComponent;
use Cake\Controller\Component\Acl\PhpAcl;
Expand Down Expand Up @@ -258,7 +253,7 @@ public function testDenyRuleIsStrongerThanAllowRule() {
*/
public function testInvalidConfigWithAroMissing() {
$this->setExpectedException(
'AclException',
'Cake\Error\AclException',
'"roles" section not found in configuration'
);
$config = array('aco' => array('allow' => array('foo' => '')));
Expand All @@ -267,7 +262,7 @@ public function testInvalidConfigWithAroMissing() {

public function testInvalidConfigWithAcosMissing() {
$this->setExpectedException(
'AclException',
'Cake\Error\AclException',
'Neither "allow" nor "deny" rules were provided in configuration.'
);

Expand Down

0 comments on commit a38cac8

Please sign in to comment.