mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
updating auth and db_acl test
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5553 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
eeeee7b49b
commit
6c1a81eeb8
2 changed files with 104 additions and 65 deletions
|
@ -36,8 +36,10 @@ uses('controller'.DS.'components'.DS.'acl', 'model'.DS.'db_acl');
|
|||
* @package cake.tests
|
||||
* @subpackage cake.tests.cases.libs.controller.components
|
||||
*/
|
||||
class AclNodeTestBase extends AclNode {
|
||||
if(!class_exists('aclnodetestbase')) {
|
||||
class AclNodeTestBase extends AclNode {
|
||||
var $useDbConfig = 'test_suite';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -46,10 +48,12 @@ class AclNodeTestBase extends AclNode {
|
|||
* @package cake.tests
|
||||
* @subpackage cake.tests.cases.libs.controller.components
|
||||
*/
|
||||
class AroTest extends AclNodeTestBase {
|
||||
if(!class_exists('arotest')) {
|
||||
class AroTest extends AclNodeTestBase {
|
||||
var $name = 'AroTest';
|
||||
var $useTable = 'aros';
|
||||
var $hasAndBelongsToMany = array('AcoTest' => array('with' => 'PermissionTest'));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -58,10 +62,12 @@ class AroTest extends AclNodeTestBase {
|
|||
* @package cake.tests
|
||||
* @subpackage cake.tests.cases.libs.controller.components
|
||||
*/
|
||||
class AcoTest extends AclNodeTestBase {
|
||||
if(!class_exists('acotest')) {
|
||||
class AcoTest extends AclNodeTestBase {
|
||||
var $name = 'AcoTest';
|
||||
var $useTable = 'acos';
|
||||
var $hasAndBelongsToMany = array('AroTest' => array('with' => 'PermissionTest'));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -70,7 +76,8 @@ class AcoTest extends AclNodeTestBase {
|
|||
* @package cake.tests
|
||||
* @subpackage cake.tests.cases.libs.controller.components
|
||||
*/
|
||||
class PermissionTest extends CakeTestModel {
|
||||
if(!class_exists('permissiontest')) {
|
||||
class PermissionTest extends CakeTestModel {
|
||||
var $name = 'PermissionTest';
|
||||
var $useTable = 'aros_acos';
|
||||
var $cacheQueries = false;
|
||||
|
@ -78,18 +85,20 @@ class PermissionTest extends CakeTestModel {
|
|||
'AcoTest' => array('foreignKey' => 'aco_id')
|
||||
);
|
||||
var $actsAs = null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Short description for class.
|
||||
*
|
||||
* @package cake.tests
|
||||
* @subpackage cake.tests.cases.libs.controller.components
|
||||
*/
|
||||
class AcoActionTest extends CakeTestModel {
|
||||
if(!class_exists('acoactiontest')) {
|
||||
class AcoActionTest extends CakeTestModel {
|
||||
var $name = 'AcoActionTest';
|
||||
var $useTable = 'aco_actions';
|
||||
var $belongsTo = array('AcoTest' => array('foreignKey' => 'aco_id'));
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Short description for class.
|
||||
|
@ -97,7 +106,8 @@ class AcoActionTest extends CakeTestModel {
|
|||
* @package cake.tests
|
||||
* @subpackage cake.tests.cases.libs.controller.components
|
||||
*/
|
||||
class DB_ACL_TEST extends DB_ACL {
|
||||
if(!class_exists('db_acl_test')) {
|
||||
class DB_ACL_TEST extends DB_ACL {
|
||||
|
||||
function __construct() {
|
||||
$this->Aro =& new AroTest();
|
||||
|
@ -105,6 +115,7 @@ class DB_ACL_TEST extends DB_ACL {
|
|||
$this->Aco =& new AcoTest();
|
||||
$this->Aro->Permission =& new PermissionTest();
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Short description for class.
|
||||
|
|
|
@ -33,65 +33,92 @@ if (!defined('CAKEPHP_UNIT_TEST_EXECUTION')) {
|
|||
uses('controller'.DS.'components'.DS.'acl', 'model'.DS.'db_acl');
|
||||
|
||||
/**
|
||||
* Short description for class.
|
||||
*
|
||||
* @package cake.tests
|
||||
* @subpackage cake.tests.cases.libs.controller.components.dbacl.models
|
||||
*/
|
||||
* Short description for class.
|
||||
*
|
||||
* @package cake.tests
|
||||
* @subpackage cake.tests.cases.libs.controller.components
|
||||
*/
|
||||
if(!class_exists('aclnodetestbase')) {
|
||||
class AclNodeTestBase extends AclNode {
|
||||
var $useDbConfig = 'test_suite';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Short description for class.
|
||||
*
|
||||
* @package cake.tests
|
||||
* @subpackage cake.tests.cases.libs.controller.components.dbacl.models
|
||||
*/
|
||||
* Short description for class.
|
||||
*
|
||||
* @package cake.tests
|
||||
* @subpackage cake.tests.cases.libs.controller.components
|
||||
*/
|
||||
if(!class_exists('arotest')) {
|
||||
class AroTest extends AclNodeTestBase {
|
||||
var $name = 'AroTest';
|
||||
var $useTable = 'aros';
|
||||
var $hasAndBelongsToMany = array('AcoTest' => array('with' => 'PermissionTest'));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Short description for class.
|
||||
*
|
||||
* @package cake.tests
|
||||
* @subpackage cake.tests.cases.libs.controller.components.dbacl.models
|
||||
*/
|
||||
* Short description for class.
|
||||
*
|
||||
* @package cake.tests
|
||||
* @subpackage cake.tests.cases.libs.controller.components
|
||||
*/
|
||||
if(!class_exists('acotest')) {
|
||||
class AcoTest extends AclNodeTestBase {
|
||||
var $name = 'AcoTest';
|
||||
var $useTable = 'acos';
|
||||
var $hasAndBelongsToMany = array('AroTest' => array('with' => 'PermissionTest'));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Short description for class.
|
||||
*
|
||||
* @package cake.tests
|
||||
* @subpackage cake.tests.cases.libs.controller.components.dbacl.models
|
||||
*/
|
||||
* Short description for class.
|
||||
*
|
||||
* @package cake.tests
|
||||
* @subpackage cake.tests.cases.libs.controller.components
|
||||
*/
|
||||
if(!class_exists('permissiontest')) {
|
||||
class PermissionTest extends CakeTestModel {
|
||||
var $name = 'PermissionTest';
|
||||
var $useTable = 'aros_acos';
|
||||
var $cacheQueries = false;
|
||||
var $belongsTo = 'AroTest,AcoTest';
|
||||
var $belongsTo = array('AroTest' => array('foreignKey' => 'aro_id'),
|
||||
'AcoTest' => array('foreignKey' => 'aco_id')
|
||||
);
|
||||
var $actsAs = null;
|
||||
}
|
||||
|
||||
}
|
||||
/**
|
||||
* Short description for class.
|
||||
*
|
||||
* @package cake.tests
|
||||
* @subpackage cake.tests.cases.libs.controller.components.dbacl.models
|
||||
*/
|
||||
* Short description for class.
|
||||
*
|
||||
* @package cake.tests
|
||||
* @subpackage cake.tests.cases.libs.controller.components
|
||||
*/
|
||||
if(!class_exists('acoactiontest')) {
|
||||
class AcoActionTest extends CakeTestModel {
|
||||
var $name = 'AcoActionTest';
|
||||
var $useTable = 'aco_actions';
|
||||
var $belongsTo = 'AcoTest';
|
||||
var $belongsTo = array('AcoTest' => array('foreignKey' => 'aco_id'));
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Short description for class.
|
||||
*
|
||||
* @package cake.tests
|
||||
* @subpackage cake.tests.cases.libs.controller.components
|
||||
*/
|
||||
if(!class_exists('db_acl_test')) {
|
||||
class DB_ACL_TEST extends DB_ACL {
|
||||
|
||||
function __construct() {
|
||||
$this->Aro =& new AroTest();
|
||||
$this->Aro->Permission =& new PermissionTest();
|
||||
$this->Aco =& new AcoTest();
|
||||
$this->Aro->Permission =& new PermissionTest();
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Short description for class.
|
||||
*
|
||||
|
@ -99,10 +126,11 @@ uses('controller'.DS.'components'.DS.'acl', 'model'.DS.'db_acl');
|
|||
* @subpackage cake.tests.cases.libs.controller.components.dbacl.models
|
||||
*/
|
||||
class AclNodeTest extends CakeTestCase {
|
||||
var $fixtures = array( 'core.aro', 'core.aco', 'core.aros_aco', 'core.aco_action' );
|
||||
var $fixtures = array( 'core.aro', 'core.aco', 'core.aros_aco', 'core.aco_action');
|
||||
|
||||
function testNodeNesting() {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
Loading…
Reference in a new issue