mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Adding test for reopened Ticket #2613.
Test proves the ticket comment that reopened it is invalid git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5599 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
981c117ae6
commit
f053eb7d26
1 changed files with 41 additions and 1 deletions
|
@ -56,7 +56,7 @@ class Test extends Model {
|
|||
array('name' => 'updated', 'type' => 'datetime', 'null' => '1', 'default' => '', 'length' => null)
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
function schema() {
|
||||
return new Set(array(
|
||||
'id'=> array('type' => 'integer', 'null' => '', 'default' => '1', 'length' => '8', 'key'=>'primary'),
|
||||
|
@ -373,6 +373,35 @@ class Bid extends CakeTestModel {
|
|||
var $name = 'Bid';
|
||||
var $belongsTo = array('Message');
|
||||
}
|
||||
class NodeAfterFind extends CakeTestModel {
|
||||
var $name = 'NodeAfterFind';
|
||||
var $validate = array('name' => VALID_NOT_EMPTY);
|
||||
var $useTable = 'apples';
|
||||
var $hasOne = array('Sample');
|
||||
var $hasMany = array('Child' => array(
|
||||
'className' => 'NodeAfterFind',
|
||||
'dependent' => true));
|
||||
var $belongsTo = array('Parent' => array(
|
||||
'className' => 'NodeAfterFind',
|
||||
'foreignKey' => 'apple_id'));
|
||||
|
||||
function afterFind($results) {
|
||||
return $results;
|
||||
}
|
||||
}
|
||||
class NodeNoAfterFind extends CakeTestModel {
|
||||
var $name = 'NodeAfterFind';
|
||||
var $validate = array('name' => VALID_NOT_EMPTY);
|
||||
var $useTable = 'apples';
|
||||
var $hasOne = array('Sample');
|
||||
var $hasMany = array('Child' => array(
|
||||
'className' => 'NodeAfterFind',
|
||||
'dependent' => true));
|
||||
var $belongsTo = array('Parent' => array(
|
||||
'className' => 'NodeAfterFind',
|
||||
'foreignKey' => 'apple_id'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Short description for class.
|
||||
*
|
||||
|
@ -1396,6 +1425,17 @@ function testRecursiveFindAllWithLimit() {
|
|||
$this->assertEqual($result, $expected);
|
||||
}
|
||||
|
||||
function testSelFAssociationAfterFind() {
|
||||
$afterFindModel =& new NodeAfterFind();
|
||||
$afterFindData = $afterFindModel->findAll();
|
||||
|
||||
$noAfterFindModel =& new NodeNoAfterFind();
|
||||
$noAfterFindData = $noAfterFindModel->findAll();
|
||||
|
||||
$this->assertNotEqual($afterFindModel, $noAfterFindModel);
|
||||
$this->assertEqual($afterFindData, $noAfterFindData);
|
||||
}
|
||||
|
||||
function testValidatesBackwards() {
|
||||
$this->model =& new TestValidate();
|
||||
|
||||
|
|
Loading…
Reference in a new issue