|
@@ -314,6 +314,28 @@ class AclBehaviorTestCase extends CakeTestCase {
|
|
|
$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);
|
|
|
|
|
+
|
|
|
|
|
+ $aroData = array(
|
|
|
|
|
+ 'Aro' => array(
|
|
|
|
|
+ 'model' => 'AclPerson',
|
|
|
|
|
+ 'foreign_key' => 1,
|
|
|
|
|
+ 'parent_id' => null
|
|
|
|
|
+ )
|
|
|
|
|
+ );
|
|
|
|
|
+ $this->Aro->create();
|
|
|
|
|
+ $this->Aro->save($aroData);
|
|
|
|
|
+
|
|
|
|
|
+ $Person->read(null, 8);
|
|
|
|
|
+ $Person->set('mother_id', 1);
|
|
|
|
|
+ $Person->save();
|
|
|
|
|
+ $result = $this->Aro->find('first', array('conditions' => array('Aro.model' => 'AclPerson', 'Aro.foreign_key' => $Person->id)));
|
|
|
|
|
+ $this->assertTrue(is_array($result));
|
|
|
|
|
+ $this->assertEqual($result['Aro']['parent_id'], 7);
|
|
|
|
|
+
|
|
|
|
|
+ $node = $Person->node(array('model' => 'AclPerson', 'foreign_key' => 8));
|
|
|
|
|
+ $this->assertEqual(sizeof($node), 2);
|
|
|
|
|
+ $this->assertEqual($node[0]['Aro']['parent_id'], 7);
|
|
|
|
|
+ $this->assertEqual($node[1]['Aro']['parent_id'], null);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|