Simplified failing test in model.test.php

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4737 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
mariano.iglesias 2007-04-01 16:15:44 +00:00
parent 2f5fa26e29
commit a48f9cd908

View file

@ -683,22 +683,29 @@ class ModelTest extends CakeTestCase {
);
$this->assertEqual($result, $expected);
$this->ArticleFeatured = new ArticleFeatured();
$this->Featured = new Featured();
$this->ArticleFeatured->Featured->recursive = 2;
$orderBy = 'ArticleFeatured.id ASC';
$this->ArticleFeatured->Featured->bindModel(array('belongsTo' =>
array('ArticleFeatured' => array('conditions' => 'ArticleFeatured.published = \'Y\'',
'fields' => 'id, title, user_id, published'))));
$this->Featured->recursive = 2;
$this->Featured->bindModel(array(
'belongsTo' => array(
'ArticleFeatured' => array(
'conditions' => 'ArticleFeatured.published = \'Y\'',
'fields' => 'id, title, user_id, published'
)
)
));
$this->ArticleFeatured->Featured->ArticleFeatured->bindModel(array('hasOne' => array('Featured'=> array('className' => 'Featured'))));
$this->ArticleFeatured->Featured->ArticleFeatured->unbindModel(array('hasMany' => array('Attachment', 'Comment'), 'hasAndBelongsToMany'=>array('Tag')));
$this->Featured->ArticleFeatured->unbindModel(array(
'hasMany' => array('Attachment', 'Comment'),
'hasAndBelongsToMany'=>array('Tag'))
);
// UNCOMMENT THE FOLLOWING LINE TO MAKE TEST SUCCEED:
//
// $this->ArticleFeatured->unbindModel(array('belongsTo'=>array('Category')));
// $this->Featured->ArticleFeatured->unbindModel(array('belongsTo'=>array('Category')));
$result = $this->ArticleFeatured->Featured->findAll(null, null, $orderBy, 3);
$orderBy = 'ArticleFeatured.id ASC';
$result = $this->Featured->findAll(null, null, $orderBy, 3);
$expected = array (
array (