diff --git a/cake/tests/cases/libs/controller/components/dbacl/models/aclnode.test.php b/cake/tests/cases/libs/controller/components/dbacl/models/aclnode.test.php index b3bc947ed..7de7dd886 100644 --- a/cake/tests/cases/libs/controller/components/dbacl/models/aclnode.test.php +++ b/cake/tests/cases/libs/controller/components/dbacl/models/aclnode.test.php @@ -31,23 +31,80 @@ } require_once LIBS.'model'.DS.'model.php'; require_once LIBS.'controller'.DS.'components'.DS.'dbacl'.DS.'models'.DS.'aclnode.php'; - require_once LIBS.'controller'.DS.'components'.DS.'dbacl'.DS.'models'.DS.'aco.php'; - require_once LIBS.'controller'.DS.'components'.DS.'dbacl'.DS.'models'.DS.'aro.php'; require_once LIBS.'controller'.DS.'components'.DS.'dbacl'.DS.'models'.DS.'permission.php'; + + /** + * Short description for class. + * + * @package cake.tests + * @subpackage cake.tests.cases.libs.controller.components.dbacl.models + */ + class AclNodeTestBase extends AclNode { + var $useDbConfig = 'test_suite'; + } + + /** + * Short description for class. + * + * @package cake.tests + * @subpackage cake.tests.cases.libs.controller.components.dbacl.models + */ + 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 + */ + 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 + */ + class PermissionTest extends CakeTestModel { + var $name = 'PermissionTest'; + var $useTable = 'aros_acos'; + var $cacheQueries = false; + var $belongsTo = 'AroTest,AcoTest'; + var $actsAs = null; + } + + /** + * Short description for class. + * + * @package cake.tests + * @subpackage cake.tests.cases.libs.controller.components.dbacl.models + */ + class AcoActionTest extends CakeTestModel { + var $name = 'AcoActionTest'; + var $useTable = 'aco_actions'; + var $belongsTo = 'AcoTest'; + } + /** * Short description for class. * * @package cake.tests * @subpackage cake.tests.cases.libs.controller.components.dbacl.models */ -class AclNodeTest extends UnitTestCase { - - function setUp() { - //$this->Aro =& new Aro(); - } - +class AclNodeTest extends CakeTestCase { + var $fixtures = array( 'core.aro', 'core.aco', 'core.aros_aco', 'core.aco_action' ); + function testNodeNesting() { - return; + $this->Aro =& new AroTest(); + $this->Aro->create(1, null, 'Food'); $this->Aro->create(2, null, 'Fruit'); $this->Aro->create(3, null, 'Red'); diff --git a/cake/tests/fixtures/aco_action_fixture.php b/cake/tests/fixtures/aco_action_fixture.php new file mode 100644 index 000000000..1f2df6fcd --- /dev/null +++ b/cake/tests/fixtures/aco_action_fixture.php @@ -0,0 +1,50 @@ + + * Copyright 2005-2007, 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-2007, 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: 4668 $ + * @modifiedby $LastChangedBy: phpnut $ + * @lastmodified $Date: 2007-03-23 19:11:06 -0300 (Vie, 23 Mar 2007) $ + * @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 AcoActionFixture extends CakeTestFixture { + var $name = 'AcoAction'; + 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( + ); +} + +?> \ No newline at end of file diff --git a/cake/tests/fixtures/aco_fixture.php b/cake/tests/fixtures/aco_fixture.php new file mode 100644 index 000000000..8d984b849 --- /dev/null +++ b/cake/tests/fixtures/aco_fixture.php @@ -0,0 +1,50 @@ + + * Copyright 2005-2007, 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-2007, 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: 4668 $ + * @modifiedby $LastChangedBy: phpnut $ + * @lastmodified $Date: 2007-03-23 19:11:06 -0300 (Vie, 23 Mar 2007) $ + * @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 AcoFixture extends CakeTestFixture { + var $name = 'Aco'; + 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( + ); +} + +?> \ No newline at end of file diff --git a/cake/tests/fixtures/aro_fixture.php b/cake/tests/fixtures/aro_fixture.php new file mode 100644 index 000000000..5dd5b5d72 --- /dev/null +++ b/cake/tests/fixtures/aro_fixture.php @@ -0,0 +1,50 @@ + + * Copyright 2005-2007, 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-2007, 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: 4668 $ + * @modifiedby $LastChangedBy: phpnut $ + * @lastmodified $Date: 2007-03-23 19:11:06 -0300 (Vie, 23 Mar 2007) $ + * @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 AroFixture extends CakeTestFixture { + var $name = 'Aro'; + 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( + ); +} + +?> \ No newline at end of file diff --git a/cake/tests/fixtures/aros_aco_fixture.php b/cake/tests/fixtures/aros_aco_fixture.php new file mode 100644 index 000000000..e5b96e5ca --- /dev/null +++ b/cake/tests/fixtures/aros_aco_fixture.php @@ -0,0 +1,50 @@ + + * Copyright 2005-2007, 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-2007, 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: 4668 $ + * @modifiedby $LastChangedBy: phpnut $ + * @lastmodified $Date: 2007-03-23 19:11:06 -0300 (Vie, 23 Mar 2007) $ + * @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 ArosAcoFixture extends CakeTestFixture { + var $name = 'ArosAco'; + 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, 'null' => false, 'default' => '0'), + '_read' => array('type' => 'string', 'length' => 2, 'null' => false, 'default' => '0'), + '_update' => array('type' => 'string', 'length' => 2, 'null' => false, 'default' => '0'), + '_delete' => array('type' => 'string', 'length' => 2, 'null' => false, 'default' => '0') + ); + var $records = array( + ); +} + +?> \ No newline at end of file