correcting name variable of AclPerson model used in acl tests

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@7438 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
AD7six 2008-08-06 14:13:01 +00:00
parent 48f55a0f56
commit 99e3b11a61

View file

@ -42,7 +42,7 @@ class AclPerson extends CakeTestModel {
* @var string * @var string
* @access public * @access public
*/ */
var $name = 'Person'; var $name = 'AclPerson';
/** /**
* useTable property * useTable property
* *
@ -95,10 +95,10 @@ class AclPerson extends CakeTestModel {
if (empty($this->data)) { if (empty($this->data)) {
$data = $this->read(); $data = $this->read();
} }
if (!$data['Person']['mother_id']) { if (!$data['AclPerson']['mother_id']) {
return null; return null;
} else { } else {
return array('Person' => array('id' => $data['Person']['mother_id'])); return array('AclPerson' => array('id' => $data['AclPerson']['mother_id']));
} }
} }
@ -241,7 +241,7 @@ class AclBehaviorTestCase extends CakeTestCase {
$aroData = array( $aroData = array(
'Aro' => array( 'Aro' => array(
'model' => 'Person', 'model' => 'AclPerson',
'foreign_key' => 2, 'foreign_key' => 2,
'parent_id' => null 'parent_id' => null
) )
@ -250,18 +250,18 @@ class AclBehaviorTestCase extends CakeTestCase {
$Person =& new AclPerson(); $Person =& new AclPerson();
$data = array( $data = array(
'Person' => array( 'AclPerson' => array(
'name' => 'Trent', 'name' => 'Trent',
'mother_id' => 2, 'mother_id' => 2,
'father_id' => 3, 'father_id' => 3,
), ),
); );
$Person->save($data); $Person->save($data);
$result = $this->Aro->find('first', array('conditions' => array('Aro.model' => 'Person', 'Aro.foreign_key' => $Person->id))); $result = $this->Aro->find('first', array('conditions' => array('Aro.model' => 'AclPerson', 'Aro.foreign_key' => $Person->id)));
$this->assertTrue(is_array($result)); $this->assertTrue(is_array($result));
$this->assertEqual($result['Aro']['parent_id'], 5); $this->assertEqual($result['Aro']['parent_id'], 5);
$node = $Person->node(array('model' => 'Person', 'foreign_key' => 8)); $node = $Person->node(array('model' => 'AclPerson', 'foreign_key' => 8));
$this->assertEqual(sizeof($node), 2); $this->assertEqual(sizeof($node), 2);
$this->assertEqual($node[0]['Aro']['parent_id'], 5); $this->assertEqual($node[0]['Aro']['parent_id'], 5);
$this->assertEqual($node[1]['Aro']['parent_id'], null); $this->assertEqual($node[1]['Aro']['parent_id'], null);
@ -275,7 +275,7 @@ class AclBehaviorTestCase extends CakeTestCase {
function testAfterDelete() { function testAfterDelete() {
$aroData = array( $aroData = array(
'Aro' => array( 'Aro' => array(
'model' => 'Person', 'model' => 'AclPerson',
'foreign_key' => 2, 'foreign_key' => 2,
'parent_id' => null 'parent_id' => null
) )
@ -283,7 +283,7 @@ class AclBehaviorTestCase extends CakeTestCase {
$this->Aro->save($aroData); $this->Aro->save($aroData);
$Person =& new AclPerson(); $Person =& new AclPerson();
$data = array( $data = array(
'Person' => array( 'AclPerson' => array(
'name' => 'Trent', 'name' => 'Trent',
'mother_id' => 2, 'mother_id' => 2,
'father_id' => 3, 'father_id' => 3,
@ -297,13 +297,13 @@ class AclBehaviorTestCase extends CakeTestCase {
$this->assertEqual($node[1]['Aro']['parent_id'], null); $this->assertEqual($node[1]['Aro']['parent_id'], null);
$Person->delete($id); $Person->delete($id);
$result = $this->Aro->find('first', array('conditions' => array('Aro.model' => 'Person', 'Aro.foreign_key' => $id))); $result = $this->Aro->find('first', array('conditions' => array('Aro.model' => 'AclPerson', 'Aro.foreign_key' => $id)));
$this->assertTrue(empty($result)); $this->assertTrue(empty($result));
$result = $this->Aro->find('first', array('conditions' => array('Aro.model' => 'Person', 'Aro.foreign_key' => 2))); $result = $this->Aro->find('first', array('conditions' => array('Aro.model' => 'AclPerson', 'Aro.foreign_key' => 2)));
$this->assertFalse(empty($result)); $this->assertFalse(empty($result));
$data = array( $data = array(
'Person' => array( 'AclPerson' => array(
'name' => 'Trent', 'name' => 'Trent',
'mother_id' => 2, 'mother_id' => 2,
'father_id' => 3, 'father_id' => 3,
@ -312,10 +312,10 @@ class AclBehaviorTestCase extends CakeTestCase {
$Person->save($data); $Person->save($data);
$id = $Person->id; $id = $Person->id;
$Person->delete(2); $Person->delete(2);
$result = $this->Aro->find('first', array('conditions' => array('Aro.model' => 'Person', 'Aro.foreign_key' => $id))); $result = $this->Aro->find('first', array('conditions' => array('Aro.model' => 'AclPerson', 'Aro.foreign_key' => $id)));
$this->assertTrue(empty($result)); $this->assertTrue(empty($result));
$result = $this->Aro->find('first', array('conditions' => array('Aro.model' => 'Person', 'Aro.foreign_key' => 2))); $result = $this->Aro->find('first', array('conditions' => array('Aro.model' => 'AclPerson', 'Aro.foreign_key' => 2)));
$this->assertTrue(empty($result)); $this->assertTrue(empty($result));
} }
@ -329,7 +329,7 @@ class AclBehaviorTestCase extends CakeTestCase {
$Person =& new AclPerson(); $Person =& new AclPerson();
$aroData = array( $aroData = array(
'Aro' => array( 'Aro' => array(
'model' => 'Person', 'model' => 'AclPerson',
'foreign_key' => 2, 'foreign_key' => 2,
'parent_id' => null 'parent_id' => null
) )