mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
Adding DbAcl test case for ticket #4288
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6530 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
b3842566dc
commit
12ae20d228
1 changed files with 62 additions and 40 deletions
|
@ -112,6 +112,7 @@ class DBACL_TEST extends DB_ACL {
|
||||||
* @subpackage cake.tests.cases.libs.controller.components.dbacl.models
|
* @subpackage cake.tests.cases.libs.controller.components.dbacl.models
|
||||||
*/
|
*/
|
||||||
class AclNodeTest extends CakeTestCase {
|
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 setUp() {
|
function setUp() {
|
||||||
|
@ -153,5 +154,26 @@ class DBACL_TEST extends DB_ACL {
|
||||||
$expected = array(6, 1);
|
$expected = array(6, 1);
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($result, $expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function testNodeAliasParenting() {
|
||||||
|
$Aco = new DbAcoTest();
|
||||||
|
$db =& ConnectionManager::getDataSource('test_suite');
|
||||||
|
$db->truncate($Aco);
|
||||||
|
$db->_queriesLog = array();
|
||||||
|
|
||||||
|
$Aco->create(array('model' => null, 'foreign_key' => null, 'parent_id' => null, 'alias' => 'Application'));
|
||||||
|
$Aco->save();
|
||||||
|
|
||||||
|
$Aco->create(array('model' => null, 'foreign_key' => null, 'parent_id' => $Aco->id, 'alias' => 'Pages'));
|
||||||
|
$Aco->save();
|
||||||
|
|
||||||
|
$result = $Aco->find('all');
|
||||||
|
$expected = array(
|
||||||
|
array('DbAcoTest' => array('id' => '1', 'parent_id' => null, 'model' => null, 'foreign_key' => null, 'alias' => 'Application', 'lft' => '1', 'rght' => '4'), 'DbAroTest' => array()),
|
||||||
|
array('DbAcoTest' => array('id' => '2', 'parent_id' => '1', 'model' => null, 'foreign_key' => null, 'alias' => 'Pages', 'lft' => '2', 'rght' => '3', ), 'DbAroTest' => array())
|
||||||
|
);
|
||||||
|
$this->assertEqual($result, $expected);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
?>
|
?>
|
Loading…
Add table
Reference in a new issue