From afaca8b37ff30c24498639b1ab6431f8e2bdfe23 Mon Sep 17 00:00:00 2001 From: Johan Meiring Date: Tue, 7 Jan 2020 11:23:43 +0200 Subject: [PATCH 1/4] Replace deprecated use of curly braces --- src/Model/Table/PermissionsTable.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Model/Table/PermissionsTable.php b/src/Model/Table/PermissionsTable.php index 60981036..328c6755 100644 --- a/src/Model/Table/PermissionsTable.php +++ b/src/Model/Table/PermissionsTable.php @@ -182,14 +182,14 @@ public function allow($aro, $aco, $actions = '*', $value = 1) $save = array_combine($permKeys, array_pad([], count($permKeys), $value)); } else { if (!is_array($actions)) { - if ($actions{0} !== '_') { + if ($actions[0] !== '_') { $actions = ['_' . $actions]; } else { $actions = [$actions]; } } foreach ($actions as $action) { - if ($action{0} !== '_') { + if ($action[0] !== '_') { $action = '_' . $action; } if (!in_array($action, $permKeys, true)) { From 7c1b3858a14c17bac8955bb24df252c934ba852f Mon Sep 17 00:00:00 2001 From: Johan Meiring Date: Tue, 7 Jan 2020 12:46:30 +0200 Subject: [PATCH 2/4] Update minimum version of CakePHP to 3.8.2 CakePHP 3.8.2 introduced a change to TestCase.php which replaced the use of curly braces for array access with square brackets, which is now required by PHP 7.4. --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index e82b5d70..6a221a1b 100644 --- a/composer.json +++ b/composer.json @@ -21,7 +21,7 @@ "source": "https://github.com/cakephp/acl" }, "require": { - "cakephp/cakephp": "^3.6.0", + "cakephp/cakephp": "^3.8.2", "cakephp/plugin-installer": "*" }, "require-dev": { From 2c5c13d0585612e315daf1c69d83b6ada89f6024 Mon Sep 17 00:00:00 2001 From: Johan Meiring Date: Tue, 7 Jan 2020 12:52:03 +0200 Subject: [PATCH 3/4] Have Travis-CI run tests etc on PHP 7.4 as well --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 83e9f260..1742f2f5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,6 +6,7 @@ php: - 7.1 - 7.2 - 7.3 + - 7.4 dist: trusty From 7ae30dc19f8bfa9e378285a32416b20d511c65eb Mon Sep 17 00:00:00 2001 From: Johan Meiring Date: Tue, 7 Jan 2020 13:22:59 +0200 Subject: [PATCH 4/4] CS fixes --- src/AclExtras.php | 14 +-- src/AclInterface.php | 2 + src/Adapter/CachedDbAcl.php | 4 +- src/Adapter/DbAcl.php | 2 + src/Adapter/IniAcl.php | 2 + src/Adapter/PhpAcl.php | 2 + src/Adapter/Utility/PhpAco.php | 2 + src/Adapter/Utility/PhpAro.php | 2 + src/Auth/ActionsAuthorize.php | 2 + src/Auth/BaseAuthorize.php | 6 +- src/Auth/CrudAuthorize.php | 2 + src/Controller/Component/AclComponent.php | 2 + src/Model/Behavior/AclBehavior.php | 2 + src/Model/Entity/Aco.php | 1 + src/Model/Entity/Aro.php | 1 + src/Model/Entity/Permission.php | 1 + src/Model/Table/AclNodesTable.php | 27 +++--- src/Model/Table/AcoActionsTable.php | 2 + src/Model/Table/AcosTable.php | 4 +- src/Model/Table/ArosTable.php | 4 +- src/Model/Table/PermissionsTable.php | 8 +- src/Shell/AclExtrasShell.php | 14 +-- src/Shell/AclShell.php | 89 ++++++++++--------- tests/Fixture/AcoActionsFixture.php | 4 +- tests/Fixture/AcoTwosFixture.php | 4 +- tests/Fixture/AcosFixture.php | 4 +- tests/Fixture/AroTwosFixture.php | 4 +- tests/Fixture/ArosAcoTwosFixture.php | 4 +- tests/Fixture/ArosAcosFixture.php | 4 +- tests/Fixture/ArosFixture.php | 6 +- tests/Fixture/PeopleFixture.php | 8 +- tests/TestCase/AclExtrasTest.php | 4 +- tests/TestCase/AclShellTest.php | 1 - tests/TestCase/Adapter/CacheDbAclTest.php | 6 +- tests/TestCase/Adapter/DbAclTest.php | 4 +- tests/TestCase/Adapter/IniAclTest.php | 4 +- tests/TestCase/Adapter/PhpAclTest.php | 2 + tests/TestCase/Auth/ActionsAuthorizeTest.php | 28 +++--- tests/TestCase/Auth/CrudAuthorizeTest.php | 12 +-- .../Controller/Component/AclComponentTest.php | 2 + .../Model/Behavior/AclBehaviorTest.php | 38 ++++---- tests/TestCase/Model/Table/AclNodesTest.php | 2 + tests/TestCase/test_admin_controllers.php | 1 + tests/TestCase/test_controllers.php | 1 + .../test_nested_plugin_controllers.php | 1 + .../test_plugin_admin_controllers.php | 1 + tests/TestCase/test_plugin_controllers.php | 1 + tests/bootstrap.php | 17 ++-- tests/test_app/config/acl.php | 4 +- 49 files changed, 224 insertions(+), 138 deletions(-) diff --git a/src/AclExtras.php b/src/AclExtras.php index c0e41c37..0054762e 100644 --- a/src/AclExtras.php +++ b/src/AclExtras.php @@ -1,4 +1,5 @@ * @license http://www.opensource.org/licenses/mit-license.php The MIT License */ + namespace Acl; use Acl\Controller\Component\AclComponent; @@ -252,7 +254,7 @@ protected function _processPlugins($root, array $plugins = []) $pluginAlias = $this->_pluginAlias($plugin); $path = [ $this->rootNode, - $pluginAlias + $pluginAlias, ]; $path = implode('/', Hash::filter($path)); $pathNode = $this->_checkNode($path, $pluginAlias, $root->id); @@ -268,7 +270,7 @@ protected function _processPlugins($root, array $plugins = []) foreach (array_keys($this->pluginPrefixes[$plugin]) as $prefix) { $path = [ $this->rootNode, - $pluginAlias + $pluginAlias, ]; $path = implode('/', Hash::filter($path)); $pluginNode = $this->_checkNode($path, $pluginAlias, $root->id); @@ -326,7 +328,7 @@ protected function _updateControllers($root, $controllers, $plugin = null, $pref $this->rootNode, $pluginPath, $prefix, - $controllerName + $controllerName, ]; $path = implode('/', Hash::filter($path)); $controllerNode = $this->_checkNode($path, $controllerName, $root->id); @@ -445,7 +447,7 @@ protected function _getCallbacks($className, $pluginPath = null, $prefixPath = n protected function _checkMethods($className, $controllerName, $node, $pluginPath = null, $prefixPath = null) { $excludes = $this->_getCallbacks($className, $pluginPath, $prefixPath); - $baseMethods = get_class_methods(new Controller); + $baseMethods = get_class_methods(new Controller()); $namespace = $this->_getNamespace($className, $pluginPath, $prefixPath); $methods = get_class_methods($namespace); if ($methods == null) { @@ -464,7 +466,7 @@ protected function _checkMethods($className, $controllerName, $node, $pluginPath $pluginPath, $prefixPath, $controllerName, - $action + $action, ]; $path = implode('/', Hash::filter($path)); $this->_checkNode($path, $action, $node->id); @@ -512,7 +514,7 @@ protected function _getNamespace($className, $pluginPath = null, $prefixPath = n $rootNamespace, 'Controller', $prefixPath, - $namespace + $namespace, ]; return implode('\\', Hash::filter($namespace)); diff --git a/src/AclInterface.php b/src/AclInterface.php index 557b5a67..1cf5026a 100644 --- a/src/AclInterface.php +++ b/src/AclInterface.php @@ -1,4 +1,5 @@ $alias, - 'foreign_key' => $ref[$name][$bindTable->getPrimaryKey()] + 'foreign_key' => $ref[$name][$bindTable->getPrimaryKey()], ]; } else { $ref = $tmpRef; diff --git a/src/Adapter/DbAcl.php b/src/Adapter/DbAcl.php index f86e2b29..5f3b3bbb 100644 --- a/src/Adapter/DbAcl.php +++ b/src/Adapter/DbAcl.php @@ -1,4 +1,5 @@ 'update', 'view' => 'read', 'delete' => 'delete', - 'remove' => 'delete' + 'remove' => 'delete', ], - 'userModel' => 'Users' + 'userModel' => 'Users', ]; /** diff --git a/src/Auth/CrudAuthorize.php b/src/Auth/CrudAuthorize.php index e21170fb..381a3b77 100644 --- a/src/Auth/CrudAuthorize.php +++ b/src/Auth/CrudAuthorize.php @@ -1,4 +1,5 @@ $ref + 'id' => $ref, ]; } elseif (is_string($ref)) { $path = explode('/', $ref); @@ -74,9 +76,9 @@ public function node($ref = null) 'table' => $table, 'alias' => "{$type}0", 'type' => 'INNER', - 'conditions' => ["{$type}0.alias" => $start] + 'conditions' => ["{$type}0.alias" => $start], ]], - 'order' => ["{$type}.lft" => 'DESC'] + 'order' => ["{$type}.lft" => 'DESC'], ]; foreach ($path as $i => $alias) { @@ -90,22 +92,23 @@ public function node($ref = null) "{$type}{$i}.lft" . ' > ' => new IdentifierExpression("{$type}{$j}.lft"), "{$type}{$i}.rght" . ' < ' => new IdentifierExpression("{$type}{$j}.rght"), "{$type}{$i}.alias" => $alias, - "{$type}{$j}.id" . ' = ' => new IdentifierExpression("{$type}{$i}.parent_id") - ] + "{$type}{$j}.id" . ' = ' => new IdentifierExpression("{$type}{$i}.parent_id"), + ], ]; $queryData['conditions'] = [ 'or' => [ ["{$type}.lft" . ' <= ' => new IdentifierExpression("{$type}0.lft"), "{$type}.rght" . ' >= ' => new IdentifierExpression("{$type}0.rght")], - ["{$type}.lft" . ' <= ' => new IdentifierExpression("{$type}{$i}.lft"), "{$type}.rght" . ' >= ' => new IdentifierExpression("{$type}{$i}.rght")] - ] + ["{$type}.lft" . ' <= ' => new IdentifierExpression("{$type}{$i}.lft"), "{$type}.rght" . ' >= ' => new IdentifierExpression("{$type}{$i}.rght")], + ], ]; } $query = $this->find('all', $queryData); $result = $query->toArray(); $path = array_values($path); - if (!isset($result[0]) || + if ( + !isset($result[0]) || (!empty($path) && $result[0]->alias != $path[count($path) - 1]) || (empty($path) && $result[0]->alias != $start) ) { @@ -123,7 +126,7 @@ public function node($ref = null) } else { $connection = Configure::read('Acl.database'); $bindTable = TableRegistry::getTableLocator()->get($name, [ - 'connection' => ConnectionManager::get($connection) + 'connection' => ConnectionManager::get($connection), ]); } $entityClass = $bindTable->getEntityClass(); @@ -143,7 +146,7 @@ public function node($ref = null) if (empty($tmpRef)) { $ref = [ 'model' => $alias, - 'foreign_key' => $ref[$name][$this->getPrimaryKey()] + 'foreign_key' => $ref[$name][$this->getPrimaryKey()], ]; } else { if (is_string($tmpRef)) { @@ -174,8 +177,8 @@ public function node($ref = null) 'conditions' => [ "{$type}.lft" . ' <= ' => new IdentifierExpression("{$type}0.lft"), "{$type}.rght" . ' >= ' => new IdentifierExpression("{$type}0.rght"), - ] - ] + ], + ], ], 'order' => ["{$type}.lft" => 'DESC'], ]; diff --git a/src/Model/Table/AcoActionsTable.php b/src/Model/Table/AcoActionsTable.php index d86a211f..167dc1db 100644 --- a/src/Model/Table/AcoActionsTable.php +++ b/src/Model/Table/AcoActionsTable.php @@ -1,4 +1,5 @@ hasMany('AcoChildren', [ 'className' => App::className('Acl.AcosTable', 'Model/Table'), - 'foreignKey' => 'parent_id' + 'foreignKey' => 'parent_id', ]); $this->setEntityClass(App::className('Acl.Aco', 'Model/Entity')); } diff --git a/src/Model/Table/ArosTable.php b/src/Model/Table/ArosTable.php index d3d65120..0e299348 100644 --- a/src/Model/Table/ArosTable.php +++ b/src/Model/Table/ArosTable.php @@ -1,4 +1,5 @@ hasMany('AroChildren', [ 'className' => App::className('Acl.ArosTable', 'Model/Table'), - 'foreignKey' => 'parent_id' + 'foreignKey' => 'parent_id', ]); $this->setEntityClass(App::className('Acl.Aro', 'Model/Entity')); diff --git a/src/Model/Table/PermissionsTable.php b/src/Model/Table/PermissionsTable.php index 328c6755..642e1f2b 100644 --- a/src/Model/Table/PermissionsTable.php +++ b/src/Model/Table/PermissionsTable.php @@ -1,4 +1,5 @@ find('all', [ 'conditions' => [ "{$permAlias}.aro_id" => $aroPaths[$i]->id, - "{$permAlias}.aco_id IN" => $acoIDs + "{$permAlias}.aco_id IN" => $acoIDs, ], 'order' => [$this->Aco->getAlias() . '.lft' => 'desc'], 'contain' => $this->Aco->getAlias(), @@ -242,8 +244,8 @@ public function getAclLink($aro, $aco) 'conditions' => [ $alias . '.aro_id' => $aro, $alias . '.aco_id' => $aco, - ] - ])->enableHydration(false)->toArray() + ], + ])->enableHydration(false)->toArray(), ], ]; diff --git a/src/Shell/AclExtrasShell.php b/src/Shell/AclExtrasShell.php index b4aa239b..1a196d7b 100644 --- a/src/Shell/AclExtrasShell.php +++ b/src/Shell/AclExtrasShell.php @@ -1,4 +1,5 @@ * @license http://www.opensource.org/licenses/mit-license.php The MIT License */ + namespace Acl\Shell; use Acl\AclExtras; @@ -113,14 +115,14 @@ public function getOptionParser() 'parser' => [ 'options' => compact('plugin'), ], - 'help' => __('Add new ACOs for new controllers and actions. Does not remove nodes from the ACO table.') + 'help' => __('Add new ACOs for new controllers and actions. Does not remove nodes from the ACO table.'), ])->addSubcommand('aco_sync', [ 'parser' => [ 'options' => compact('plugin'), ], 'help' => __('Perform a full sync on the ACO table.' . 'Will create new ACOs or missing controllers and actions.' . - 'Will also remove orphaned entries that no longer have a matching controller/action') + 'Will also remove orphaned entries that no longer have a matching controller/action'), ])->addSubcommand('recover', [ 'help' => __('Recover a corrupted Tree'), 'parser' => [ @@ -128,10 +130,10 @@ public function getOptionParser() 'type' => [ 'required' => true, 'help' => __('The type of tree to recover'), - 'choices' => ['aco', 'aro'] - ] - ] - ] + 'choices' => ['aco', 'aro'], + ], + ], + ], ]); return $parser; diff --git a/src/Shell/AclShell.php b/src/Shell/AclShell.php index 02153cf9..30fac5b3 100644 --- a/src/Shell/AclShell.php +++ b/src/Shell/AclShell.php @@ -1,4 +1,5 @@ $this->_getNodeId($class, $target), - 'parent_id' => $this->_getNodeId($class, $parent) + 'parent_id' => $this->_getNodeId($class, $parent), ]; $entity = $this->Acl->{$class}->newEntity($data); if (!$this->Acl->{$class}->save($entity)) { @@ -311,15 +314,15 @@ public function view() $identity = $this->parseIdentifier($this->args[1]); $topNode = $this->Acl->{$class}->find('all', [ - 'conditions' => [$alias . '.id' => $this->_getNodeId($class, $identity)] + 'conditions' => [$alias . '.id' => $this->_getNodeId($class, $identity)], ])->first(); $nodes = $this->Acl->{$class}->find('all', [ 'conditions' => [ $alias . '.lft >=' => $topNode->lft, - $alias . '.lft <=' => $topNode->rght + $alias . '.lft <=' => $topNode->rght, ], - 'order' => $alias . '.lft ASC' + 'order' => $alias . '.lft ASC', ]); } else { $nodes = $this->Acl->{$class}->find('all', ['order' => $alias . '.lft ASC']); @@ -372,7 +375,7 @@ public function getOptionParser() $type = [ 'choices' => ['aro', 'aco'], 'required' => true, - 'help' => __d('cake_acl', 'Type of node to create.') + 'help' => __d('cake_acl', 'Type of node to create.'), ]; $parser->setDescription( @@ -386,14 +389,14 @@ public function getOptionParser() 'type' => $type, 'parent' => [ 'help' => __d('cake_acl', 'The node selector for the parent.'), - 'required' => true + 'required' => true, ], 'alias' => [ 'help' => __d('cake_acl', 'The alias to use for the newly created node.'), - 'required' => true - ] - ] - ] + 'required' => true, + ], + ], + ], ])->addSubcommand('delete', [ 'help' => __d('cake_acl', 'Deletes the ACL object with the given reference'), 'parser' => [ @@ -403,9 +406,9 @@ public function getOptionParser() 'node' => [ 'help' => __d('cake_acl', 'The node identifier to delete.'), 'required' => true, - ] - ] - ] + ], + ], + ], ])->addSubcommand('setparent', [ 'help' => __d('cake_acl', 'Moves the ACL node under a new parent.'), 'parser' => [ @@ -418,86 +421,86 @@ public function getOptionParser() ], 'parent' => [ 'help' => __d('cake_acl', 'The new parent for .'), - 'required' => true - ] - ] - ] + 'required' => true, + ], + ], + ], ])->addSubcommand('getpath', [ 'help' => __d('cake_acl', 'Print out the path to an ACL node.'), 'parser' => [ 'description' => [ __d('cake_acl', "Returns the path to the ACL object specified by ."), - __d('cake_acl', "This command is useful in determining the inheritance of permissions for a certain object in the tree.") + __d('cake_acl', "This command is useful in determining the inheritance of permissions for a certain object in the tree."), ], 'arguments' => [ 'type' => $type, 'node' => [ 'help' => __d('cake_acl', 'The node to get the path of'), 'required' => true, - ] - ] - ] + ], + ], + ], ])->addSubcommand('check', [ 'help' => __d('cake_acl', 'Check the permissions between an ACO and ARO.'), 'parser' => [ 'description' => [ - __d('cake_acl', 'Use this command to check ACL permissions.') + __d('cake_acl', 'Use this command to check ACL permissions.'), ], 'arguments' => [ 'aro' => ['help' => __d('cake_acl', 'ARO to check.'), 'required' => true], 'aco' => ['help' => __d('cake_acl', 'ACO to check.'), 'required' => true], - 'action' => ['help' => __d('cake_acl', 'Action to check'), 'default' => 'all'] - ] - ] + 'action' => ['help' => __d('cake_acl', 'Action to check'), 'default' => 'all'], + ], + ], ])->addSubcommand('grant', [ 'help' => __d('cake_acl', 'Grant an ARO permissions to an ACO.'), 'parser' => [ 'description' => [ - __d('cake_acl', 'Use this command to grant ACL permissions. Once executed, the ARO specified (and its children, if any) will have ALLOW access to the specified ACO action (and the ACO\'s children, if any).') + __d('cake_acl', 'Use this command to grant ACL permissions. Once executed, the ARO specified (and its children, if any) will have ALLOW access to the specified ACO action (and the ACO\'s children, if any).'), ], 'arguments' => [ 'aro' => ['help' => __d('cake_acl', 'ARO to grant permission to.'), 'required' => true], 'aco' => ['help' => __d('cake_acl', 'ACO to grant access to.'), 'required' => true], - 'action' => ['help' => __d('cake_acl', 'Action to grant'), 'default' => 'all'] - ] - ] + 'action' => ['help' => __d('cake_acl', 'Action to grant'), 'default' => 'all'], + ], + ], ])->addSubcommand('deny', [ 'help' => __d('cake_acl', 'Deny an ARO permissions to an ACO.'), 'parser' => [ 'description' => [ - __d('cake_acl', 'Use this command to deny ACL permissions. Once executed, the ARO specified (and its children, if any) will have DENY access to the specified ACO action (and the ACO\'s children, if any).') + __d('cake_acl', 'Use this command to deny ACL permissions. Once executed, the ARO specified (and its children, if any) will have DENY access to the specified ACO action (and the ACO\'s children, if any).'), ], 'arguments' => [ 'aro' => ['help' => __d('cake_acl', 'ARO to deny.'), 'required' => true], 'aco' => ['help' => __d('cake_acl', 'ACO to deny.'), 'required' => true], - 'action' => ['help' => __d('cake_acl', 'Action to deny'), 'default' => 'all'] - ] - ] + 'action' => ['help' => __d('cake_acl', 'Action to deny'), 'default' => 'all'], + ], + ], ])->addSubcommand('inherit', [ 'help' => __d('cake_acl', 'Inherit an ARO\'s parent permissions.'), 'parser' => [ 'description' => [ - __d('cake_acl', "Use this command to force a child ARO object to inherit its permissions settings from its parent.") + __d('cake_acl', "Use this command to force a child ARO object to inherit its permissions settings from its parent."), ], 'arguments' => [ 'aro' => ['help' => __d('cake_acl', 'ARO to have permissions inherit.'), 'required' => true], 'aco' => ['help' => __d('cake_acl', 'ACO to inherit permissions on.'), 'required' => true], - 'action' => ['help' => __d('cake_acl', 'Action to inherit'), 'default' => 'all'] - ] - ] + 'action' => ['help' => __d('cake_acl', 'Action to inherit'), 'default' => 'all'], + ], + ], ])->addSubcommand('view', [ 'help' => __d('cake_acl', 'View a tree or a single node\'s subtree.'), 'parser' => [ 'description' => [ __d('cake_acl', "The view command will return the ARO or ACO tree."), __d('cake_acl', "The optional node parameter allows you to return"), - __d('cake_acl', "only a portion of the requested tree.") + __d('cake_acl', "only a portion of the requested tree."), ], 'arguments' => [ 'type' => $type, - 'node' => ['help' => __d('cake_acl', 'The optional node to view the subtree of.')] - ] - ] + 'node' => ['help' => __d('cake_acl', 'The optional node to view the subtree of.')], + ], + ], ])->setEpilog( [ 'Node and parent arguments can be in one of the following formats:', @@ -508,7 +511,7 @@ public function getOptionParser() " i.e. 'John'. When used with , this takes the form of an alias path,", " i.e. //.", '', - "To add a node at the root level, enter 'root' or '/' as the parameter." + "To add a node at the root level, enter 'root' or '/' as the parameter.", ] ); diff --git a/tests/Fixture/AcoActionsFixture.php b/tests/Fixture/AcoActionsFixture.php index 724ce0ae..4f91ca7e 100644 --- a/tests/Fixture/AcoActionsFixture.php +++ b/tests/Fixture/AcoActionsFixture.php @@ -1,4 +1,5 @@ * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) @@ -11,6 +12,7 @@ * @link http://book.cakephp.org/2.0/en/development/testing.html CakePHP(tm) Tests * @license http://www.opensource.org/licenses/mit-license.php MIT License */ + namespace Acl\Test\Fixture; use Cake\TestSuite\Fixture\TestFixture; @@ -35,7 +37,7 @@ class AcoActionsFixture extends TestFixture 'alias' => ['type' => 'string', 'default' => ''], 'lft' => ['type' => 'integer', 'length' => 10, 'null' => true], 'rght' => ['type' => 'integer', 'length' => 10, 'null' => true], - '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]] + '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]], ]; /** diff --git a/tests/Fixture/AcoTwosFixture.php b/tests/Fixture/AcoTwosFixture.php index fffb4067..e9c35d8f 100644 --- a/tests/Fixture/AcoTwosFixture.php +++ b/tests/Fixture/AcoTwosFixture.php @@ -1,4 +1,5 @@ * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) @@ -11,6 +12,7 @@ * @link http://book.cakephp.org/2.0/en/development/testing.html CakePHP(tm) Tests * @license http://www.opensource.org/licenses/mit-license.php MIT License */ + namespace Acl\Test\Fixture; use Cake\TestSuite\Fixture\TestFixture; @@ -35,7 +37,7 @@ class AcoTwosFixture extends TestFixture 'alias' => ['type' => 'string', 'default' => ''], 'lft' => ['type' => 'integer', 'length' => 10, 'null' => true], 'rght' => ['type' => 'integer', 'length' => 10, 'null' => true], - '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]] + '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]], ]; /** diff --git a/tests/Fixture/AcosFixture.php b/tests/Fixture/AcosFixture.php index adffeb3e..52c7abad 100644 --- a/tests/Fixture/AcosFixture.php +++ b/tests/Fixture/AcosFixture.php @@ -1,4 +1,5 @@ * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) @@ -11,6 +12,7 @@ * @link http://book.cakephp.org/2.0/en/development/testing.html CakePHP(tm) Tests * @license http://www.opensource.org/licenses/mit-license.php MIT License */ + namespace Acl\Test\Fixture; use Cake\TestSuite\Fixture\TestFixture; @@ -35,7 +37,7 @@ class AcosFixture extends TestFixture 'alias' => ['type' => 'string', 'default' => ''], 'lft' => ['type' => 'integer', 'length' => 10, 'null' => true], 'rght' => ['type' => 'integer', 'length' => 10, 'null' => true], - '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]] + '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]], ]; /** diff --git a/tests/Fixture/AroTwosFixture.php b/tests/Fixture/AroTwosFixture.php index 83a6bf9e..a0ff84f9 100644 --- a/tests/Fixture/AroTwosFixture.php +++ b/tests/Fixture/AroTwosFixture.php @@ -1,4 +1,5 @@ * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) @@ -11,6 +12,7 @@ * @link http://book.cakephp.org/2.0/en/development/testing.html CakePHP(tm) Tests * @license http://www.opensource.org/licenses/mit-license.php MIT License */ + namespace Acl\Test\Fixture; use Cake\TestSuite\Fixture\TestFixture; @@ -35,7 +37,7 @@ class AroTwosFixture extends TestFixture 'alias' => ['type' => 'string', 'default' => ''], 'lft' => ['type' => 'integer', 'length' => 10, 'null' => true], 'rght' => ['type' => 'integer', 'length' => 10, 'null' => true], - '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]] + '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]], ]; /** diff --git a/tests/Fixture/ArosAcoTwosFixture.php b/tests/Fixture/ArosAcoTwosFixture.php index 246dc8c3..1b39398c 100644 --- a/tests/Fixture/ArosAcoTwosFixture.php +++ b/tests/Fixture/ArosAcoTwosFixture.php @@ -1,4 +1,5 @@ * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) @@ -11,6 +12,7 @@ * @link http://book.cakephp.org/2.0/en/development/testing.html CakePHP(tm) Tests * @license http://www.opensource.org/licenses/mit-license.php MIT License */ + namespace Acl\Test\Fixture; use Cake\TestSuite\Fixture\TestFixture; @@ -35,7 +37,7 @@ class ArosAcoTwosFixture extends TestFixture '_read' => ['type' => 'string', 'length' => 2, 'default' => 0], '_update' => ['type' => 'string', 'length' => 2, 'default' => 0], '_delete' => ['type' => 'string', 'length' => 2, 'default' => 0], - '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]] + '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]], ]; /** diff --git a/tests/Fixture/ArosAcosFixture.php b/tests/Fixture/ArosAcosFixture.php index 9a340e08..d7e0de48 100644 --- a/tests/Fixture/ArosAcosFixture.php +++ b/tests/Fixture/ArosAcosFixture.php @@ -1,4 +1,5 @@ * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) @@ -11,6 +12,7 @@ * @link http://book.cakephp.org/2.0/en/development/testing.html CakePHP(tm) Tests * @license http://www.opensource.org/licenses/mit-license.php MIT License */ + namespace Acl\Test\Fixture; use Cake\TestSuite\Fixture\TestFixture; @@ -35,7 +37,7 @@ class ArosAcosFixture extends TestFixture '_read' => ['type' => 'string', 'length' => 2, 'default' => 0], '_update' => ['type' => 'string', 'length' => 2, 'default' => 0], '_delete' => ['type' => 'string', 'length' => 2, 'default' => 0], - '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]] + '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]], ]; /** diff --git a/tests/Fixture/ArosFixture.php b/tests/Fixture/ArosFixture.php index dd4bb284..ea7ceefa 100644 --- a/tests/Fixture/ArosFixture.php +++ b/tests/Fixture/ArosFixture.php @@ -1,4 +1,5 @@ * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) @@ -11,6 +12,7 @@ * @link http://book.cakephp.org/2.0/en/development/testing.html CakePHP(tm) Tests * @license http://www.opensource.org/licenses/mit-license.php MIT License */ + namespace Acl\Test\Fixture; use Cake\TestSuite\Fixture\TestFixture; @@ -35,7 +37,7 @@ class ArosFixture extends TestFixture 'alias' => ['type' => 'string', 'default' => ''], 'lft' => ['type' => 'integer', 'length' => 10, 'null' => true], 'rght' => ['type' => 'integer', 'length' => 10, 'null' => true], - '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]] + '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]], ]; /** @@ -47,6 +49,6 @@ class ArosFixture extends TestFixture ['parent_id' => null, 'model' => null, 'foreign_key' => null, 'alias' => 'ROOT', 'lft' => 1, 'rght' => 8], ['parent_id' => '1', 'model' => 'Group', 'foreign_key' => '1', 'alias' => 'admins', 'lft' => 2, 'rght' => 7], ['parent_id' => '2', 'model' => 'AuthUser', 'foreign_key' => '1', 'alias' => 'Gandalf', 'lft' => 3, 'rght' => 4], - ['parent_id' => '2', 'model' => 'AuthUser', 'foreign_key' => '2', 'alias' => 'Elrond', 'lft' => 5, 'rght' => 6] + ['parent_id' => '2', 'model' => 'AuthUser', 'foreign_key' => '2', 'alias' => 'Elrond', 'lft' => 5, 'rght' => 6], ]; } diff --git a/tests/Fixture/PeopleFixture.php b/tests/Fixture/PeopleFixture.php index edd83e0b..9ca46e4d 100644 --- a/tests/Fixture/PeopleFixture.php +++ b/tests/Fixture/PeopleFixture.php @@ -1,4 +1,5 @@ * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) @@ -11,6 +12,7 @@ * @link http://book.cakephp.org/2.0/en/development/testing.html CakePHP(tm) Tests * @license http://www.opensource.org/licenses/mit-license.php MIT License */ + namespace Acl\Test\Fixture; use Cake\TestSuite\Fixture\TestFixture; @@ -35,8 +37,8 @@ class PeopleFixture extends TestFixture 'PRIMARY' => ['type' => 'primary', 'columns' => ['id']], ], '_indexes' => [ - 'mother_id' => ['type' => 'index', 'columns' => ['mother_id', 'father_id']] - ] + 'mother_id' => ['type' => 'index', 'columns' => ['mother_id', 'father_id']], + ], ]; /** @@ -51,6 +53,6 @@ class PeopleFixture extends TestFixture ['name' => 'mother - grand mother', 'mother_id' => 0, 'father_id' => 0], ['name' => 'mother - grand father', 'mother_id' => 0, 'father_id' => 0], ['name' => 'father - grand mother', 'mother_id' => 0, 'father_id' => 0], - ['name' => 'father - grand father', 'mother_id' => 0, 'father_id' => 0] + ['name' => 'father - grand father', 'mother_id' => 0, 'father_id' => 0], ]; } diff --git a/tests/TestCase/AclExtrasTest.php b/tests/TestCase/AclExtrasTest.php index 9f901e11..ad612b0c 100644 --- a/tests/TestCase/AclExtrasTest.php +++ b/tests/TestCase/AclExtrasTest.php @@ -1,4 +1,5 @@ * @license http://www.opensource.org/licenses/mit-license.php The MIT License */ + namespace Acl\Test\TestCase; use Cake\Core\Configure; @@ -242,7 +244,7 @@ protected function _createNode($parent, $expected) $result = $Aco->node($parent)->toArray(); $new = [ 'parent_id' => $result[0]['id'], - 'alias' => 'someMethod' + 'alias' => 'someMethod', ]; $new = $Aco->newEntity($new); $Aco->save($new); diff --git a/tests/TestCase/AclShellTest.php b/tests/TestCase/AclShellTest.php index e7a53431..a2a4e7c9 100644 --- a/tests/TestCase/AclShellTest.php +++ b/tests/TestCase/AclShellTest.php @@ -3,7 +3,6 @@ namespace Acl\Test\TestCase; use Acl\Shell\AclShell; - use Cake\Core\Configure; use Cake\ORM\TableRegistry; use Cake\TestSuite\TestCase; diff --git a/tests/TestCase/Adapter/CacheDbAclTest.php b/tests/TestCase/Adapter/CacheDbAclTest.php index bfc28bb1..27de6558 100644 --- a/tests/TestCase/Adapter/CacheDbAclTest.php +++ b/tests/TestCase/Adapter/CacheDbAclTest.php @@ -1,4 +1,5 @@ 'File', 'path' => TMP . 'test_acl', - 'prefix' => 'test_' + 'prefix' => 'test_', ]); } @@ -115,7 +117,7 @@ public function testCacheKeys() $this->assertSame('users_1_print', $this->CachedDb->getCacheKey(['model' => 'Users', 'foreign_key' => 1], 'print', '*')); $entity = new Entity([ - 'id' => '1' + 'id' => '1', ], ['source' => 'Users']); $this->assertSame('users_1_print', $this->CachedDb->getCacheKey($entity, 'print', '*')); } diff --git a/tests/TestCase/Adapter/DbAclTest.php b/tests/TestCase/Adapter/DbAclTest.php index b79d4fb5..c7e153e1 100644 --- a/tests/TestCase/Adapter/DbAclTest.php +++ b/tests/TestCase/Adapter/DbAclTest.php @@ -1,4 +1,5 @@ '7', 'parent_id' => '4', 'model' => 'User', 'foreign_key' => 3, 'alias' => 'Samir'], ['id' => '4', 'parent_id' => '1', 'model' => 'Group', 'foreign_key' => 3, 'alias' => 'users'], - ['id' => '1', 'parent_id' => null, 'model' => null, 'foreign_key' => null, 'alias' => 'root'] + ['id' => '1', 'parent_id' => null, 'model' => null, 'foreign_key' => null, 'alias' => 'root'], ]; $this->assertEquals($expected, $result); diff --git a/tests/TestCase/Adapter/IniAclTest.php b/tests/TestCase/Adapter/IniAclTest.php index e57fdce4..b98c9978 100644 --- a/tests/TestCase/Adapter/IniAclTest.php +++ b/tests/TestCase/Adapter/IniAclTest.php @@ -1,4 +1,5 @@ ['username' => 'admin'] + 'User' => ['username' => 'admin'], ]; $this->assertTrue($this->Acl->check($user, 'posts')); } diff --git a/tests/TestCase/Adapter/PhpAclTest.php b/tests/TestCase/Adapter/PhpAclTest.php index fabafaf9..3a9d2d4b 100644 --- a/tests/TestCase/Adapter/PhpAclTest.php +++ b/tests/TestCase/Adapter/PhpAclTest.php @@ -1,4 +1,5 @@ [ 'id' => 1, - 'user' => 'mariano' - ] + 'user' => 'mariano', + ], ]; $request = new ServerRequest('/posts/index'); $request = $request->withAttribute('params', [ 'plugin' => null, 'controller' => 'posts', - 'action' => 'index' + 'action' => 'index', ]); $this->_mockAcl(); @@ -98,14 +100,14 @@ public function testAuthorizeSuccess() $user = [ 'Users' => [ 'id' => 1, - 'user' => 'mariano' - ] + 'user' => 'mariano', + ], ]; $request = new ServerRequest('/posts/index'); $request = $request->withAttribute('params', [ 'plugin' => null, 'controller' => 'posts', - 'action' => 'index' + 'action' => 'index', ]); $this->_mockAcl(); @@ -129,7 +131,7 @@ public function testAuthorizeSettings() $request = $request->withAttribute('params', [ 'plugin' => null, 'controller' => 'posts', - 'action' => 'index' + 'action' => 'index', ]); $this->_mockAcl(); @@ -137,7 +139,7 @@ public function testAuthorizeSettings() $this->auth->setConfig('userModel', 'TestPlugin.AuthUser'); $user = [ 'id' => 1, - 'username' => 'mariano' + 'username' => 'mariano', ]; $expected = ['TestPlugin.AuthUser' => ['id' => 1, 'username' => 'mariano']]; @@ -160,7 +162,7 @@ public function testActionMethod() $request = $request->withAttribute('params', [ 'plugin' => null, 'controller' => 'posts', - 'action' => 'index' + 'action' => 'index', ]); $result = $this->auth->action($request); @@ -179,7 +181,7 @@ public function testActionNoDoubleSlash() $request = $request->withAttribute('params', [ 'plugin' => null, 'controller' => 'posts', - 'action' => 'index' + 'action' => 'index', ]); $result = $this->auth->action($request); $this->assertEquals('controllers/Posts/index', $result); @@ -196,7 +198,7 @@ public function testActionWithPlugin() $request = $request->withAttribute('params', [ 'plugin' => 'debug_kit', 'controller' => 'posts', - 'action' => 'index' + 'action' => 'index', ]); $result = $this->auth->action($request); @@ -210,7 +212,7 @@ public function testActionWithPluginAndPrefix() 'plugin' => 'debug_kit', 'prefix' => 'admin', 'controller' => 'posts', - 'action' => 'index' + 'action' => 'index', ]); $result = $this->auth->action($request); @@ -224,7 +226,7 @@ public function testActionWithPrefix() 'plugin' => null, 'prefix' => 'admin', 'controller' => 'posts', - 'action' => 'index' + 'action' => 'index', ]); $result = $this->auth->action($request); diff --git a/tests/TestCase/Auth/CrudAuthorizeTest.php b/tests/TestCase/Auth/CrudAuthorizeTest.php index e9a53b4b..6191b3f4 100644 --- a/tests/TestCase/Auth/CrudAuthorizeTest.php +++ b/tests/TestCase/Auth/CrudAuthorizeTest.php @@ -1,4 +1,5 @@ withAttribute('params', [ 'controller' => 'posts', - 'action' => 'foobar' + 'action' => 'foobar', ]); $user = ['User' => ['username' => 'mark']]; @@ -87,7 +89,7 @@ public function testAuthorizeCheckSuccess() $request = new ServerRequest('posts/index'); $request = $request->withAttribute('params', [ 'controller' => 'posts', - 'action' => 'index' + 'action' => 'index', ]); $user = ['Users' => ['username' => 'mark']]; @@ -110,7 +112,7 @@ public function testAuthorizeCheckFailure() $request = new ServerRequest('posts/index'); $request = $request->withAttribute('params', [ 'controller' => 'posts', - 'action' => 'index' + 'action' => 'index', ]); $user = ['Users' => ['username' => 'mark']]; @@ -137,7 +139,7 @@ public function testMapActionsGet() 'add' => 'create', 'edit' => 'update', 'view' => 'read', - 'remove' => 'delete' + 'remove' => 'delete', ]; $this->assertEquals($expected, $result); } @@ -153,7 +155,7 @@ public function testMapActionsSet() 'create' => ['generate'], 'read' => ['listing', 'show'], 'update' => ['update'], - 'random' => 'custom' + 'random' => 'custom', ]; $result = $this->auth->mapActions($map); $this->assertNull($result); diff --git a/tests/TestCase/Controller/Component/AclComponentTest.php b/tests/TestCase/Controller/Component/AclComponentTest.php index 666a6477..cb3975d1 100644 --- a/tests/TestCase/Controller/Component/AclComponentTest.php +++ b/tests/TestCase/Controller/Component/AclComponentTest.php @@ -1,4 +1,5 @@ * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) @@ -11,6 +12,7 @@ * @link http://book.cakephp.org/2.0/en/development/testing.html CakePHP(tm) Tests * @license http://www.opensource.org/licenses/mit-license.php MIT License */ + namespace Acl\Test\TestCase\Controller\Component; use Acl\Controller\Component\AclComponent; diff --git a/tests/TestCase/Model/Behavior/AclBehaviorTest.php b/tests/TestCase/Model/Behavior/AclBehaviorTest.php index f0b5b347..dcb504ad 100644 --- a/tests/TestCase/Model/Behavior/AclBehaviorTest.php +++ b/tests/TestCase/Model/Behavior/AclBehaviorTest.php @@ -1,4 +1,5 @@ hasMany('Child', [ 'className' => __NAMESPACE__ . '\AclPeople', - 'foreignKey' => 'mother_id' + 'foreignKey' => 'mother_id', ]); } } @@ -270,11 +272,11 @@ public function testAfterSave() 'author_id' => 1, 'title' => 'Acl Post', 'body' => 'post body', - 'published' => 1 + 'published' => 1, ]); $saved = $Post->save($data); $query = $this->Aco->find('all', [ - 'conditions' => ['model' => $Post->getAlias(), 'foreign_key' => $saved->id] + 'conditions' => ['model' => $Post->getAlias(), 'foreign_key' => $saved->id], ]); $this->assertTrue(is_object($query)); $result = $query->first(); @@ -286,14 +288,14 @@ public function testAfterSave() $aroData = new AclPerson([ 'model' => $Person->getAlias(), 'foreign_key' => 2, - 'parent_id' => null + 'parent_id' => null, ]); $this->Aro->save($aroData); $acoData = new AclPerson([ 'model' => $Person->getAlias(), 'foreign_key' => 2, - 'parent_id' => null + 'parent_id' => null, ]); $this->Aco->save($acoData); @@ -304,7 +306,7 @@ public function testAfterSave() ]); $saved = $Person->save($data); $result = $this->Aro->find('all', [ - 'conditions' => ['model' => $Person->getAlias(), 'foreign_key' => $saved->id] + 'conditions' => ['model' => $Person->getAlias(), 'foreign_key' => $saved->id], ])->first(); $this->assertEquals(5, $result->parent_id); @@ -317,19 +319,19 @@ public function testAfterSave() $aroData = $this->Aro->save(new AclPerson([ 'model' => $Person->getAlias(), 'foreign_key' => 1, - 'parent_id' => null + 'parent_id' => null, ])); $acoData = $this->Aco->save(new AclPerson([ 'model' => $Person->getAlias(), 'foreign_key' => 1, - 'parent_id' => null + 'parent_id' => null, ])); $person = $Person->findById(8)->first(); $person->mother_id = 1; $person = $Person->save($person); $result = $this->Aro->find('all', [ - 'conditions' => ['model' => $Person->getAlias(), 'foreign_key' => $person->id] + 'conditions' => ['model' => $Person->getAlias(), 'foreign_key' => $person->id], ])->first(); $this->assertEquals(7, $result->parent_id); @@ -366,7 +368,7 @@ public function testAfterSaveUpdateParentIdNotNull() 'father_id' => 3, ])); $result = $this->Aro->find('all', [ - 'conditions' => ['model' => $Person->getAlias(), 'foreign_key' => $person->id] + 'conditions' => ['model' => $Person->getAlias(), 'foreign_key' => $person->id], ])->first(); $this->assertEquals(5, $result->parent_id); @@ -377,7 +379,7 @@ public function testAfterSaveUpdateParentIdNotNull() 'source' => $Person->getAlias(), ])); $result = $this->Aro->find('all', [ - 'conditions' => ['model' => $Person->getAlias(), 'foreign_key' => $person->id] + 'conditions' => ['model' => $Person->getAlias(), 'foreign_key' => $person->id], ])->first(); $this->assertEquals(5, $result->parent_id); } @@ -394,13 +396,13 @@ public function testAfterDelete() $this->Aro->save(new Aro([ 'model' => $Person->getAlias(), 'foreign_key' => 2, - 'parent_id' => null + 'parent_id' => null, ])); $this->Aco->save(new Aco([ 'model' => $Person->getAlias(), 'foreign_key' => 2, - 'parent_id' => null + 'parent_id' => null, ])); $Person->deleteAll(['name' => 'person']); @@ -417,11 +419,11 @@ public function testAfterDelete() $Person->delete($person); $result = $this->Aro->find('all', [ - 'conditions' => ['model' => $Person->getAlias(), 'foreign_key' => $person->id] + 'conditions' => ['model' => $Person->getAlias(), 'foreign_key' => $person->id], ]); $this->assertTrue($result->count() === 0); $result = $this->Aro->find('all', [ - 'conditions' => ['model' => $Person->getAlias(), 'foreign_key' => 2] + 'conditions' => ['model' => $Person->getAlias(), 'foreign_key' => 2], ]); $this->assertTrue($result->count() > 0); @@ -435,12 +437,12 @@ public function testAfterDelete() $Person->delete($person); $result = $this->Aro->find('all', [ - 'conditions' => ['model' => $Person->getAlias(), 'foreign_key' => $person->id] + 'conditions' => ['model' => $Person->getAlias(), 'foreign_key' => $person->id], ]); $this->assertTrue($result->count() === 0); $result = $this->Aro->find('all', [ - 'conditions' => ['model' => $Person->getAlias(), 'foreign_key' => 2] + 'conditions' => ['model' => $Person->getAlias(), 'foreign_key' => 2], ]); $this->assertTrue($result->count() === 0); } @@ -456,7 +458,7 @@ public function testNode() $this->Aro->save(new Aro([ 'model' => $Person->getAlias(), 'foreign_key' => 2, - 'parent_id' => null + 'parent_id' => null, ])); $person = new AclPerson(['id' => 2], ['source' => $Person->getAlias()]); diff --git a/tests/TestCase/Model/Table/AclNodesTest.php b/tests/TestCase/Model/Table/AclNodesTest.php index ebcbf81b..81a0c9ec 100644 --- a/tests/TestCase/Model/Table/AclNodesTest.php +++ b/tests/TestCase/Model/Table/AclNodesTest.php @@ -1,4 +1,5 @@ * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) @@ -11,6 +12,7 @@ * @link http://book.cakephp.org/2.0/en/development/testing.html CakePHP(tm) Tests * @license http://www.opensource.org/licenses/mit-license.php MIT License */ + namespace Acl\Test\TestCase\Model\Table; use Acl\Adapter\DbAcl; diff --git a/tests/TestCase/test_admin_controllers.php b/tests/TestCase/test_admin_controllers.php index 3563b448..3b7aff64 100644 --- a/tests/TestCase/test_admin_controllers.php +++ b/tests/TestCase/test_admin_controllers.php @@ -1,4 +1,5 @@ register(); $loader->addNamespace('Cake\Test\Fixture', ROOT . '/vendor/cakephp/cakephp/tests/Fixture'); @@ -78,21 +79,21 @@ 'cssBaseUrl' => 'css/', 'paths' => [ 'plugins' => [TEST_APP . 'Plugin' . DS], - 'templates' => [APP . 'Template' . DS] - ] + 'templates' => [APP . 'Template' . DS], + ], ]); Cache::setConfig([ '_cake_core_' => [ 'engine' => 'File', 'prefix' => 'cake_core_', - 'serialize' => true + 'serialize' => true, ], '_cake_model_' => [ 'engine' => 'File', 'prefix' => 'cake_model_', - 'serialize' => true - ] + 'serialize' => true, + ], ]); // Ensure default test connection is defined @@ -113,7 +114,7 @@ ]); Configure::write('Session', [ - 'defaults' => 'php' + 'defaults' => 'php', ]); Log::setConfig([ @@ -126,7 +127,7 @@ 'engine' => 'Cake\Log\Engine\FileLog', 'levels' => ['warning', 'error', 'critical', 'alert', 'emergency'], 'file' => 'error', - ] + ], ]); if (class_exists('Carbon\Carbon')) { diff --git a/tests/test_app/config/acl.php b/tests/test_app/config/acl.php index 8adce7fe..e30bb38f 100644 --- a/tests/test_app/config/acl.php +++ b/tests/test_app/config/acl.php @@ -64,9 +64,9 @@ // accountants and sales should not delete anything '/controllers/*/delete' => [ 'Role/sales', - 'Role/accounting' + 'Role/accounting', ], '/controllers/db/drop' => 'User/db_manager_2', ], - ] + ], ];