mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-18 18:46:17 +00:00
updating acl.test with new fixtures. reverting modified acl related fixtures used for db_acl.test
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6851 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
4621e68803
commit
2334a27f51
8 changed files with 275 additions and 121 deletions
|
@ -29,44 +29,38 @@
|
||||||
if (!defined('CAKEPHP_UNIT_TEST_EXECUTION')) {
|
if (!defined('CAKEPHP_UNIT_TEST_EXECUTION')) {
|
||||||
define('CAKEPHP_UNIT_TEST_EXECUTION', 1);
|
define('CAKEPHP_UNIT_TEST_EXECUTION', 1);
|
||||||
}
|
}
|
||||||
App::import('Core', array('Component', 'Controller'));
|
App::import(array('controller'.DS.'components'.DS.'acl', 'model'.DS.'db_acl'));
|
||||||
App::import('Component', array('Acl'));
|
|
||||||
uses('model'.DS.'db_acl');
|
|
||||||
|
|
||||||
|
|
||||||
class AclNodeTestBase extends AclNode {
|
class AclNodeTwoTestBase extends AclNode {
|
||||||
var $useDbConfig = 'test_suite';
|
var $useDbConfig = 'test_suite';
|
||||||
var $cacheSources = false;
|
var $cacheSources = false;
|
||||||
}
|
}
|
||||||
class AroTest extends AclNodeTestBase {
|
class AroTwoTest extends AclNodeTwoTestBase {
|
||||||
var $name = 'AroTest';
|
var $name = 'AroTwoTest';
|
||||||
var $useTable = 'aros';
|
var $useTable = 'aro_twos';
|
||||||
var $hasAndBelongsToMany = array('AcoTest' => array('with' => 'PermissionTest'));
|
var $hasAndBelongsToMany = array('AcoTwoTest' => array('with' => 'PermissionTwoTest'));
|
||||||
}
|
}
|
||||||
class AcoTest extends AclNodeTestBase {
|
class AcoTwoTest extends AclNodeTwoTestBase {
|
||||||
var $name = 'AcoTest';
|
var $name = 'AcoTwoTest';
|
||||||
var $useTable = 'acos';
|
var $useTable = 'aco_twos';
|
||||||
var $hasAndBelongsToMany = array('AroTest' => array('with' => 'PermissionTest'));
|
var $hasAndBelongsToMany = array('AroTwoTest' => array('with' => 'PermissionTwoTest'));
|
||||||
}
|
}
|
||||||
class PermissionTest extends CakeTestModel {
|
class PermissionTwoTest extends CakeTestModel {
|
||||||
var $name = 'PermissionTest';
|
var $name = 'PermissionTwoTest';
|
||||||
var $useTable = 'aros_acos';
|
var $useTable = 'aros_aco_twos';
|
||||||
var $cacheQueries = false;
|
var $cacheQueries = false;
|
||||||
var $belongsTo = array('AroTest' => array('foreignKey' => 'aro_id'), 'AcoTest' => array('foreignKey' => 'aco_id'));
|
var $belongsTo = array('AroTwoTest' => array('foreignKey' => 'aro_id'), 'AcoTwoTest' => array('foreignKey' => 'aco_id'));
|
||||||
var $actsAs = null;
|
var $actsAs = null;
|
||||||
}
|
}
|
||||||
class AcoActionTest extends CakeTestModel {
|
|
||||||
var $name = 'AcoActionTest';
|
class DB_ACL_TWO_TEST extends DB_ACL {
|
||||||
var $useTable = 'aco_actions';
|
|
||||||
var $belongsTo = array('AcoTest' => array('foreignKey' => 'aco_id'));
|
|
||||||
}
|
|
||||||
class DB_ACL_TEST extends DB_ACL {
|
|
||||||
|
|
||||||
function __construct() {
|
function __construct() {
|
||||||
$this->Aro =& new AroTest();
|
$this->Aro =& new AroTwoTest();
|
||||||
$this->Aro->Permission =& new PermissionTest();
|
$this->Aro->Permission =& new PermissionTwoTest();
|
||||||
$this->Aco =& new AcoTest();
|
$this->Aco =& new AcoTwoTest();
|
||||||
$this->Aro->Permission =& new PermissionTest();
|
$this->Aro->Permission =& new PermissionTwoTest();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
class INI_ACL_TEST extends INI_ACL {
|
class INI_ACL_TEST extends INI_ACL {
|
||||||
|
@ -81,14 +75,14 @@ class INI_ACL_TEST extends INI_ACL {
|
||||||
*/
|
*/
|
||||||
class AclComponentTest extends CakeTestCase {
|
class AclComponentTest extends CakeTestCase {
|
||||||
|
|
||||||
var $fixtures = array('core.aro', 'core.aco', 'core.aros_aco');
|
var $fixtures = array('core.aro_two', 'core.aco_two', 'core.aros_aco_two');
|
||||||
|
|
||||||
function startTest() {
|
function startTest() {
|
||||||
$this->Acl =& new AclComponent();
|
$this->Acl =& new AclComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
function before($method) {
|
function before($method) {
|
||||||
Configure::write('Acl.classname', 'DB_ACL_TEST');
|
Configure::write('Acl.classname', 'DB_ACL_TWO_TEST');
|
||||||
Configure::write('Acl.database', 'test_suite');
|
Configure::write('Acl.database', 'test_suite');
|
||||||
parent::before($method);
|
parent::before($method);
|
||||||
}
|
}
|
||||||
|
@ -106,7 +100,7 @@ class AclComponentTest extends CakeTestCase {
|
||||||
$this->assertTrue($this->Acl->Aro->save());
|
$this->assertTrue($this->Acl->Aro->save());
|
||||||
|
|
||||||
$root = $this->Acl->Aco->node('ROOT');
|
$root = $this->Acl->Aco->node('ROOT');
|
||||||
$parent = $root[0]['AcoTest']['id'];
|
$parent = $root[0]['AcoTwoTest']['id'];
|
||||||
|
|
||||||
$this->Acl->Aco->create(array('parent_id' => $parent, 'alias' => 'Drinks'));
|
$this->Acl->Aco->create(array('parent_id' => $parent, 'alias' => 'Drinks'));
|
||||||
$this->assertTrue($this->Acl->Aco->save());
|
$this->assertTrue($this->Acl->Aco->save());
|
||||||
|
@ -176,9 +170,9 @@ class AclComponentTest extends CakeTestCase {
|
||||||
$this->assertFalse($this->Acl->check('Samir', 'refill', 'read'));
|
$this->assertFalse($this->Acl->check('Samir', 'refill', 'read'));
|
||||||
$this->assertFalse($this->Acl->check('Samir', 'refill', 'delete'));
|
$this->assertFalse($this->Acl->check('Samir', 'refill', 'delete'));
|
||||||
|
|
||||||
$result = $this->Acl->Aro->Permission->find('all', array('conditions' => array('AroTest.alias' => 'Samir')));
|
$result = $this->Acl->Aro->Permission->find('all', array('conditions' => array('AroTwoTest.alias' => 'Samir')));
|
||||||
$expected = '-1';
|
$expected = '-1';
|
||||||
$this->assertEqual($result[0]['PermissionTest']['_delete'], $expected);
|
$this->assertEqual($result[0]['PermissionTwoTest']['_delete'], $expected);
|
||||||
|
|
||||||
$this->expectError('DB_ACL::allow() - Invalid node');
|
$this->expectError('DB_ACL::allow() - Invalid node');
|
||||||
$this->assertFalse($this->Acl->deny('Lumbergh', 'ROOT/tpsReports/DoesNotExist', 'create'));
|
$this->assertFalse($this->Acl->deny('Lumbergh', 'ROOT/tpsReports/DoesNotExist', 'create'));
|
||||||
|
@ -187,18 +181,18 @@ class AclComponentTest extends CakeTestCase {
|
||||||
function testAclNodeLookup() {
|
function testAclNodeLookup() {
|
||||||
$result = $this->Acl->Aro->node('root/users/Samir');
|
$result = $this->Acl->Aro->node('root/users/Samir');
|
||||||
$expected = array(
|
$expected = array(
|
||||||
array('AroTest' => array('id' => '7', 'parent_id' => '4', 'model' => 'User', 'foreign_key' => 3, 'alias' => 'Samir')),
|
array('AroTwoTest' => array('id' => '7', 'parent_id' => '4', 'model' => 'User', 'foreign_key' => 3, 'alias' => 'Samir')),
|
||||||
array('AroTest' => array('id' => '4', 'parent_id' => '1', 'model' => 'Group', 'foreign_key' => 3, 'alias' => 'users')),
|
array('AroTwoTest' => array('id' => '4', 'parent_id' => '1', 'model' => 'Group', 'foreign_key' => 3, 'alias' => 'users')),
|
||||||
array('AroTest' => array('id' => '1', 'parent_id' => null, 'model' => null, 'foreign_key' => null, 'alias' => 'root'))
|
array('AroTwoTest' => array('id' => '1', 'parent_id' => null, 'model' => null, 'foreign_key' => null, 'alias' => 'root'))
|
||||||
);
|
);
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($result, $expected);
|
||||||
|
|
||||||
$result = $this->Acl->Aco->node('ROOT/tpsReports/view/current');
|
$result = $this->Acl->Aco->node('ROOT/tpsReports/view/current');
|
||||||
$expected = array(
|
$expected = array(
|
||||||
array('AcoTest' => array('id' => '4', 'parent_id' => '3', 'model' => null, 'foreign_key' => null, 'alias' => 'current')),
|
array('AcoTwoTest' => array('id' => '4', 'parent_id' => '3', 'model' => null, 'foreign_key' => null, 'alias' => 'current')),
|
||||||
array('AcoTest' => array('id' => '3', 'parent_id' => '2', 'model' => null, 'foreign_key' => null, 'alias' => 'view')),
|
array('AcoTwoTest' => array('id' => '3', 'parent_id' => '2', 'model' => null, 'foreign_key' => null, 'alias' => 'view')),
|
||||||
array('AcoTest' => array('id' => '2', 'parent_id' => '1', 'model' => null, 'foreign_key' => null, 'alias' => 'tpsReports')),
|
array('AcoTwoTest' => array('id' => '2', 'parent_id' => '1', 'model' => null, 'foreign_key' => null, 'alias' => 'tpsReports')),
|
||||||
array('AcoTest' => array('id' => '1', 'parent_id' => null, 'model' => null, 'foreign_key' => null, 'alias' => 'ROOT')),
|
array('AcoTwoTest' => array('id' => '1', 'parent_id' => null, 'model' => null, 'foreign_key' => null, 'alias' => 'ROOT')),
|
||||||
);
|
);
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($result, $expected);
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,7 +30,7 @@ if (!defined('CAKEPHP_UNIT_TEST_EXECUTION')) {
|
||||||
define('CAKEPHP_UNIT_TEST_EXECUTION', 1);
|
define('CAKEPHP_UNIT_TEST_EXECUTION', 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
uses('controller'.DS.'components'.DS.'acl', 'model'.DS.'db_acl');
|
App::import(array('controller'.DS.'components'.DS.'acl', 'model'.DS.'db_acl'));
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Short description for class.
|
* Short description for class.
|
||||||
|
|
20
cake/tests/fixtures/aco_fixture.php
vendored
20
cake/tests/fixtures/aco_fixture.php
vendored
|
@ -45,17 +45,15 @@ class AcoFixture extends CakeTestFixture {
|
||||||
);
|
);
|
||||||
|
|
||||||
var $records = array(
|
var $records = array(
|
||||||
array('parent_id' => null, 'model' => null, 'foreign_key' => null, 'alias' => 'ROOT', 'lft' => 1, 'rght' => 20),
|
array('parent_id' => null, 'model' => null, 'foreign_key' => null, 'alias' => 'ROOT', 'lft' => 1, 'rght' => 18),
|
||||||
array('parent_id' => 1, 'model' => null, 'foreign_key' => null, 'alias' => 'tpsReports', 'lft' => 2, 'rght' => 9),
|
array('parent_id' => 1, 'model' => null, 'foreign_key' => null, 'alias' => 'Controller1', 'lft' => 2, 'rght' => 9),
|
||||||
array('parent_id' => 2, 'model' => null, 'foreign_key' => null, 'alias' => 'view', 'lft' => 3, 'rght' => 6),
|
array('parent_id' => 2, 'model' => null, 'foreign_key' => null, 'alias' => 'action1', 'lft' => 3, 'rght' => 6),
|
||||||
array('parent_id' => 3, 'model' => null, 'foreign_key' => null, 'alias' => 'current', 'lft' => 4, 'rght' => 5),
|
array('parent_id' => 3, 'model' => null, 'foreign_key' => null, 'alias' => 'record1', 'lft' => 4, 'rght' => 5),
|
||||||
array('parent_id' => 2, 'model' => null, 'foreign_key' => null, 'alias' => 'update', 'lft' => 7, 'rght' => 8),
|
array('parent_id' => 2, 'model' => null, 'foreign_key' => null, 'alias' => 'action2', 'lft' => 7, 'rght' => 8),
|
||||||
array('parent_id' => 1, 'model' => null, 'foreign_key' => null, 'alias' => 'printers', 'lft' => 10, 'rght' => 19),
|
array('parent_id' => 1, 'model' => null, 'foreign_key' => null, 'alias' => 'Controller2', 'lft' => 10, 'rght' => 17),
|
||||||
array('parent_id' => 6, 'model' => null, 'foreign_key' => null, 'alias' => 'print', 'lft' => 11, 'rght' => 14),
|
array('parent_id' => 6, 'model' => null, 'foreign_key' => null, 'alias' => 'action1', 'lft' => 11, 'rght' => 14),
|
||||||
array('parent_id' => 7, 'model' => null, 'foreign_key' => null, 'alias' => 'lettersize', 'lft' => 12, 'rght' => 13),
|
array('parent_id' => 7, 'model' => null, 'foreign_key' => null, 'alias' => 'record1', 'lft' => 12, 'rght' => 13),
|
||||||
array('parent_id' => 6, 'model' => null, 'foreign_key' => null, 'alias' => 'refill', 'lft' => 15, 'rght' => 16),
|
array('parent_id' => 6, 'model' => null, 'foreign_key' => null, 'alias' => 'action2', 'lft' => 15, 'rght' => 16),
|
||||||
array('parent_id' => 6, 'model' => null, 'foreign_key' => null, 'alias' => 'smash', 'lft' => 17, 'rght' => 18),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
61
cake/tests/fixtures/aco_two_fixture.php
vendored
Normal file
61
cake/tests/fixtures/aco_two_fixture.php
vendored
Normal file
|
@ -0,0 +1,61 @@
|
||||||
|
<?php
|
||||||
|
/* SVN FILE: $Id$ */
|
||||||
|
/**
|
||||||
|
* Short description for file.
|
||||||
|
*
|
||||||
|
* Long description for file
|
||||||
|
*
|
||||||
|
* PHP versions 4 and 5
|
||||||
|
*
|
||||||
|
* CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
|
||||||
|
* Copyright 2005-2008, Cake Software Foundation, Inc.
|
||||||
|
* 1785 E. Sahara Avenue, Suite 490-204
|
||||||
|
* Las Vegas, Nevada 89104
|
||||||
|
*
|
||||||
|
* Licensed under The Open Group Test Suite License
|
||||||
|
* Redistributions of files must retain the above copyright notice.
|
||||||
|
*
|
||||||
|
* @filesource
|
||||||
|
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc.
|
||||||
|
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
|
||||||
|
* @package cake.tests
|
||||||
|
* @subpackage cake.tests.fixtures
|
||||||
|
* @since CakePHP(tm) v 1.2.0.4667
|
||||||
|
* @version $Revision$
|
||||||
|
* @modifiedby $LastChangedBy$
|
||||||
|
* @lastmodified $Date$
|
||||||
|
* @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
* Short description for class.
|
||||||
|
*
|
||||||
|
* @package cake.tests
|
||||||
|
* @subpackage cake.tests.fixtures
|
||||||
|
*/
|
||||||
|
class AcoTwoFixture extends CakeTestFixture {
|
||||||
|
var $name = 'AcoTwo';
|
||||||
|
var $fields = array(
|
||||||
|
'id' => array('type' => 'integer', 'key' => 'primary'),
|
||||||
|
'parent_id' => array('type' => 'integer', 'length' => 10, 'null' => true),
|
||||||
|
'model' => array('type' => 'string', 'default' => ''),
|
||||||
|
'foreign_key' => array('type' => 'integer', 'length' => 10, 'null' => true),
|
||||||
|
'alias' => array('type' => 'string', 'default' => ''),
|
||||||
|
'lft' => array('type' => 'integer', 'length' => 10, 'null' => true),
|
||||||
|
'rght' => array('type' => 'integer', 'length' => 10, 'null' => true)
|
||||||
|
);
|
||||||
|
|
||||||
|
var $records = array(
|
||||||
|
array('parent_id' => null, 'model' => null, 'foreign_key' => null, 'alias' => 'ROOT', 'lft' => 1, 'rght' => 20),
|
||||||
|
array('parent_id' => 1, 'model' => null, 'foreign_key' => null, 'alias' => 'tpsReports', 'lft' => 2, 'rght' => 9),
|
||||||
|
array('parent_id' => 2, 'model' => null, 'foreign_key' => null, 'alias' => 'view', 'lft' => 3, 'rght' => 6),
|
||||||
|
array('parent_id' => 3, 'model' => null, 'foreign_key' => null, 'alias' => 'current', 'lft' => 4, 'rght' => 5),
|
||||||
|
array('parent_id' => 2, 'model' => null, 'foreign_key' => null, 'alias' => 'update', 'lft' => 7, 'rght' => 8),
|
||||||
|
array('parent_id' => 1, 'model' => null, 'foreign_key' => null, 'alias' => 'printers', 'lft' => 10, 'rght' => 19),
|
||||||
|
array('parent_id' => 6, 'model' => null, 'foreign_key' => null, 'alias' => 'print', 'lft' => 11, 'rght' => 14),
|
||||||
|
array('parent_id' => 7, 'model' => null, 'foreign_key' => null, 'alias' => 'lettersize', 'lft' => 12, 'rght' => 13),
|
||||||
|
array('parent_id' => 6, 'model' => null, 'foreign_key' => null, 'alias' => 'refill', 'lft' => 15, 'rght' => 16),
|
||||||
|
array('parent_id' => 6, 'model' => null, 'foreign_key' => null, 'alias' => 'smash', 'lft' => 17, 'rght' => 18),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
10
cake/tests/fixtures/aro_fixture.php
vendored
10
cake/tests/fixtures/aro_fixture.php
vendored
|
@ -46,16 +46,6 @@ class AroFixture extends CakeTestFixture {
|
||||||
);
|
);
|
||||||
|
|
||||||
var $records = array(
|
var $records = array(
|
||||||
array('parent_id' => null, 'model' => null, 'foreign_key' => null, 'alias' => 'root', 'lft' => '1', 'rght' => '20'),
|
|
||||||
array('parent_id' => 1, 'model' => 'Group', 'foreign_key' => '1', 'alias' => 'admin', 'lft' => '2', 'rght' => '5'),
|
|
||||||
array('parent_id' => 1, 'model' => 'Group', 'foreign_key' => '2', 'alias' => 'managers', 'lft' => '6', 'rght' => '9'),
|
|
||||||
array('parent_id' => 1, 'model' => 'Group', 'foreign_key' => '3', 'alias' => 'users', 'lft' => '10', 'rght' => '19'),
|
|
||||||
array('parent_id' => 2, 'model' => 'User', 'foreign_key' => '1', 'alias' => 'Bobs', 'lft' => '3', 'rght' => '4' ),
|
|
||||||
array('parent_id' => 3, 'model' => 'User', 'foreign_key' => '2', 'alias' => 'Lumbergh', 'lft' => '7' , 'rght' => '8'),
|
|
||||||
array('parent_id' => 4, 'model' => 'User', 'foreign_key' => '3', 'alias' => 'Samir', 'lft' => '11' , 'rght' => '12' ),
|
|
||||||
array('parent_id' => 4, 'model' => 'User', 'foreign_key' => '4', 'alias' => 'Micheal', 'lft' => '13', 'rght' => '14'),
|
|
||||||
array('parent_id' => 4, 'model' => 'User', 'foreign_key' => '5', 'alias' => 'Peter', 'lft' => '15', 'rght' => '16'),
|
|
||||||
array('parent_id' => 4, 'model' => 'User', 'foreign_key' => '6', 'alias' => 'Milton', 'lft' => '17', 'rght' => '18'),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
62
cake/tests/fixtures/aro_two_fixture.php
vendored
Normal file
62
cake/tests/fixtures/aro_two_fixture.php
vendored
Normal file
|
@ -0,0 +1,62 @@
|
||||||
|
<?php
|
||||||
|
/* SVN FILE: $Id$ */
|
||||||
|
/**
|
||||||
|
* Short description for file.
|
||||||
|
*
|
||||||
|
* Long description for file
|
||||||
|
*
|
||||||
|
* PHP versions 4 and 5
|
||||||
|
*
|
||||||
|
* CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
|
||||||
|
* Copyright 2005-2008, Cake Software Foundation, Inc.
|
||||||
|
* 1785 E. Sahara Avenue, Suite 490-204
|
||||||
|
* Las Vegas, Nevada 89104
|
||||||
|
*
|
||||||
|
* Licensed under The Open Group Test Suite License
|
||||||
|
* Redistributions of files must retain the above copyright notice.
|
||||||
|
*
|
||||||
|
* @filesource
|
||||||
|
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc.
|
||||||
|
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
|
||||||
|
* @package cake.tests
|
||||||
|
* @subpackage cake.tests.fixtures
|
||||||
|
* @since CakePHP(tm) v 1.2.0.4667
|
||||||
|
* @version $Revision$
|
||||||
|
* @modifiedby $LastChangedBy$
|
||||||
|
* @lastmodified $Date$
|
||||||
|
* @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
* Short description for class.
|
||||||
|
*
|
||||||
|
* @package cake.tests
|
||||||
|
* @subpackage cake.tests.fixtures
|
||||||
|
*/
|
||||||
|
class AroTwoFixture extends CakeTestFixture {
|
||||||
|
var $name = 'AroTwo';
|
||||||
|
|
||||||
|
var $fields = array(
|
||||||
|
'id' => array('type' => 'integer', 'key' => 'primary'),
|
||||||
|
'parent_id' => array('type' => 'integer', 'length' => 10, 'null' => true),
|
||||||
|
'model' => array('type' => 'string', 'default' => ''),
|
||||||
|
'foreign_key' => array('type' => 'integer', 'length' => 10, 'null' => true),
|
||||||
|
'alias' => array('type' => 'string', 'default' => ''),
|
||||||
|
'lft' => array('type' => 'integer', 'length' => 10, 'null' => true),
|
||||||
|
'rght' => array('type' => 'integer', 'length' => 10, 'null' => true)
|
||||||
|
);
|
||||||
|
|
||||||
|
var $records = array(
|
||||||
|
array('parent_id' => null, 'model' => null, 'foreign_key' => null, 'alias' => 'root', 'lft' => '1', 'rght' => '20'),
|
||||||
|
array('parent_id' => 1, 'model' => 'Group', 'foreign_key' => '1', 'alias' => 'admin', 'lft' => '2', 'rght' => '5'),
|
||||||
|
array('parent_id' => 1, 'model' => 'Group', 'foreign_key' => '2', 'alias' => 'managers', 'lft' => '6', 'rght' => '9'),
|
||||||
|
array('parent_id' => 1, 'model' => 'Group', 'foreign_key' => '3', 'alias' => 'users', 'lft' => '10', 'rght' => '19'),
|
||||||
|
array('parent_id' => 2, 'model' => 'User', 'foreign_key' => '1', 'alias' => 'Bobs', 'lft' => '3', 'rght' => '4' ),
|
||||||
|
array('parent_id' => 3, 'model' => 'User', 'foreign_key' => '2', 'alias' => 'Lumbergh', 'lft' => '7' , 'rght' => '8'),
|
||||||
|
array('parent_id' => 4, 'model' => 'User', 'foreign_key' => '3', 'alias' => 'Samir', 'lft' => '11' , 'rght' => '12' ),
|
||||||
|
array('parent_id' => 4, 'model' => 'User', 'foreign_key' => '4', 'alias' => 'Micheal', 'lft' => '13', 'rght' => '14'),
|
||||||
|
array('parent_id' => 4, 'model' => 'User', 'foreign_key' => '5', 'alias' => 'Peter', 'lft' => '15', 'rght' => '16'),
|
||||||
|
array('parent_id' => 4, 'model' => 'User', 'foreign_key' => '6', 'alias' => 'Milton', 'lft' => '17', 'rght' => '18'),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
23
cake/tests/fixtures/aros_aco_fixture.php
vendored
23
cake/tests/fixtures/aros_aco_fixture.php
vendored
|
@ -43,28 +43,7 @@ class ArosAcoFixture extends CakeTestFixture {
|
||||||
'_update' => array('type' => 'string', 'length' => 2, 'default' => 0),
|
'_update' => array('type' => 'string', 'length' => 2, 'default' => 0),
|
||||||
'_delete' => array('type' => 'string', 'length' => 2, 'default' => 0)
|
'_delete' => array('type' => 'string', 'length' => 2, 'default' => 0)
|
||||||
);
|
);
|
||||||
var $records = array(
|
var $records = array();
|
||||||
array('aro_id' => '1', 'aco_id' => '1', '_create' => '-1', '_read' => '-1', '_update' => '-1', '_delete' => '-1'),
|
|
||||||
array('aro_id' => '2', 'aco_id' => '1', '_create' => '0', '_read' => '1', '_update' => '1', '_delete' => '1'),
|
|
||||||
array('aro_id' => '3', 'aco_id' => '2', '_create' => '0', '_read' => '1', '_update' => '0', '_delete' => '0'),
|
|
||||||
array('aro_id' => '4', 'aco_id' => '2', '_create' => '1', '_read' => '1', '_update' => '0', '_delete' => '-1'),
|
|
||||||
array('aro_id' => '4', 'aco_id' => '6', '_create' => '1', '_read' => '1', '_update' => '0', '_delete' => '0'),
|
|
||||||
array('aro_id' => '5', 'aco_id' => '1', '_create' => '1', '_read' => '1', '_update' => '1', '_delete' => '1'),
|
|
||||||
array('aro_id' => '6', 'aco_id' => '3', '_create' => '-1', '_read' => '1', '_update' => '-1', '_delete' => '-1'),
|
|
||||||
array('aro_id' => '6', 'aco_id' => '4', '_create' => '-1', '_read' => '1', '_update' => '-1', '_delete' => '1'),
|
|
||||||
array('aro_id' => '6', 'aco_id' => '6', '_create' => '-1', '_read' => '1', '_update' => '1', '_delete' => '-1'),
|
|
||||||
array('aro_id' => '7', 'aco_id' => '2', '_create' => '-1', '_read' => '-1', '_update' => '-1', '_delete' => '-1'),
|
|
||||||
array('aro_id' => '7', 'aco_id' => '7', '_create' => '1', '_read' => '1', '_update' => '1', '_delete' => '0'),
|
|
||||||
array('aro_id' => '7', 'aco_id' => '8', '_create' => '1', '_read' => '1', '_update' => '1', '_delete' => '0'),
|
|
||||||
array('aro_id' => '7', 'aco_id' => '9', '_create' => '1', '_read' => '1', '_update' => '1', '_delete' => '1'),
|
|
||||||
array('aro_id' => '7', 'aco_id' => '10', '_create' => '0', '_read' => '0', '_update' => '0', '_delete' => '1'),
|
|
||||||
array('aro_id' => '8', 'aco_id' => '10', '_create' => '1', '_read' => '1', '_update' => '1', '_delete' => '1'),
|
|
||||||
array('aro_id' => '8', 'aco_id' => '2', '_create' => '-1', '_read' => '-1', '_update' => '-1', '_delete' => '-1'),
|
|
||||||
array('aro_id' => '9', 'aco_id' => '4', '_create' => '1', '_read' => '1', '_update' => '1', '_delete' => '-1'),
|
|
||||||
array('aro_id' => '9', 'aco_id' => '9', '_create' => '0', '_read' => '0', '_update' => '1', '_delete' => '1'),
|
|
||||||
array('aro_id' => '10', 'aco_id' => '9', '_create' => '1', '_read' => '1', '_update' => '1', '_delete' => '1'),
|
|
||||||
array('aro_id' => '10', 'aco_id' => '10', '_create' => '-1', '_read' => '-1', '_update' => '-1', '_delete' => '-1'),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
70
cake/tests/fixtures/aros_aco_two_fixture.php
vendored
Normal file
70
cake/tests/fixtures/aros_aco_two_fixture.php
vendored
Normal file
|
@ -0,0 +1,70 @@
|
||||||
|
<?php
|
||||||
|
/* SVN FILE: $Id$ */
|
||||||
|
/**
|
||||||
|
* Short description for file.
|
||||||
|
*
|
||||||
|
* Long description for file
|
||||||
|
*
|
||||||
|
* PHP versions 4 and 5
|
||||||
|
*
|
||||||
|
* CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
|
||||||
|
* Copyright 2005-2008, Cake Software Foundation, Inc.
|
||||||
|
* 1785 E. Sahara Avenue, Suite 490-204
|
||||||
|
* Las Vegas, Nevada 89104
|
||||||
|
*
|
||||||
|
* Licensed under The Open Group Test Suite License
|
||||||
|
* Redistributions of files must retain the above copyright notice.
|
||||||
|
*
|
||||||
|
* @filesource
|
||||||
|
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc.
|
||||||
|
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
|
||||||
|
* @package cake.tests
|
||||||
|
* @subpackage cake.tests.fixtures
|
||||||
|
* @since CakePHP(tm) v 1.2.0.4667
|
||||||
|
* @version $Revision$
|
||||||
|
* @modifiedby $LastChangedBy$
|
||||||
|
* @lastmodified $Date$
|
||||||
|
* @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
* Short description for class.
|
||||||
|
*
|
||||||
|
* @package cake.tests
|
||||||
|
* @subpackage cake.tests.fixtures
|
||||||
|
*/
|
||||||
|
class ArosAcoTwoFixture extends CakeTestFixture {
|
||||||
|
var $name = 'ArosAcoTwo';
|
||||||
|
var $fields = array(
|
||||||
|
'id' => array('type' => 'integer', 'key' => 'primary'),
|
||||||
|
'aro_id' => array('type' => 'integer', 'length' => 10, 'null' => false),
|
||||||
|
'aco_id' => array('type' => 'integer', 'length' => 10, 'null' => false),
|
||||||
|
'_create' => array('type' => 'string', 'length' => 2, 'default' => 0),
|
||||||
|
'_read' => array('type' => 'string', 'length' => 2, 'default' => 0),
|
||||||
|
'_update' => array('type' => 'string', 'length' => 2, 'default' => 0),
|
||||||
|
'_delete' => array('type' => 'string', 'length' => 2, 'default' => 0)
|
||||||
|
);
|
||||||
|
var $records = array(
|
||||||
|
array('aro_id' => '1', 'aco_id' => '1', '_create' => '-1', '_read' => '-1', '_update' => '-1', '_delete' => '-1'),
|
||||||
|
array('aro_id' => '2', 'aco_id' => '1', '_create' => '0', '_read' => '1', '_update' => '1', '_delete' => '1'),
|
||||||
|
array('aro_id' => '3', 'aco_id' => '2', '_create' => '0', '_read' => '1', '_update' => '0', '_delete' => '0'),
|
||||||
|
array('aro_id' => '4', 'aco_id' => '2', '_create' => '1', '_read' => '1', '_update' => '0', '_delete' => '-1'),
|
||||||
|
array('aro_id' => '4', 'aco_id' => '6', '_create' => '1', '_read' => '1', '_update' => '0', '_delete' => '0'),
|
||||||
|
array('aro_id' => '5', 'aco_id' => '1', '_create' => '1', '_read' => '1', '_update' => '1', '_delete' => '1'),
|
||||||
|
array('aro_id' => '6', 'aco_id' => '3', '_create' => '-1', '_read' => '1', '_update' => '-1', '_delete' => '-1'),
|
||||||
|
array('aro_id' => '6', 'aco_id' => '4', '_create' => '-1', '_read' => '1', '_update' => '-1', '_delete' => '1'),
|
||||||
|
array('aro_id' => '6', 'aco_id' => '6', '_create' => '-1', '_read' => '1', '_update' => '1', '_delete' => '-1'),
|
||||||
|
array('aro_id' => '7', 'aco_id' => '2', '_create' => '-1', '_read' => '-1', '_update' => '-1', '_delete' => '-1'),
|
||||||
|
array('aro_id' => '7', 'aco_id' => '7', '_create' => '1', '_read' => '1', '_update' => '1', '_delete' => '0'),
|
||||||
|
array('aro_id' => '7', 'aco_id' => '8', '_create' => '1', '_read' => '1', '_update' => '1', '_delete' => '0'),
|
||||||
|
array('aro_id' => '7', 'aco_id' => '9', '_create' => '1', '_read' => '1', '_update' => '1', '_delete' => '1'),
|
||||||
|
array('aro_id' => '7', 'aco_id' => '10', '_create' => '0', '_read' => '0', '_update' => '0', '_delete' => '1'),
|
||||||
|
array('aro_id' => '8', 'aco_id' => '10', '_create' => '1', '_read' => '1', '_update' => '1', '_delete' => '1'),
|
||||||
|
array('aro_id' => '8', 'aco_id' => '2', '_create' => '-1', '_read' => '-1', '_update' => '-1', '_delete' => '-1'),
|
||||||
|
array('aro_id' => '9', 'aco_id' => '4', '_create' => '1', '_read' => '1', '_update' => '1', '_delete' => '-1'),
|
||||||
|
array('aro_id' => '9', 'aco_id' => '9', '_create' => '0', '_read' => '0', '_update' => '1', '_delete' => '1'),
|
||||||
|
array('aro_id' => '10', 'aco_id' => '9', '_create' => '1', '_read' => '1', '_update' => '1', '_delete' => '1'),
|
||||||
|
array('aro_id' => '10', 'aco_id' => '10', '_create' => '-1', '_read' => '-1', '_update' => '-1', '_delete' => '-1'),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
Loading…
Add table
Reference in a new issue