From a48f9cd9080b356004de6633d9b5e331b9b2a8dc Mon Sep 17 00:00:00 2001 From: "mariano.iglesias" Date: Sun, 1 Apr 2007 16:15:44 +0000 Subject: [PATCH] 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 --- cake/tests/cases/libs/model/model.test.php | 27 ++++++++++++++-------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/cake/tests/cases/libs/model/model.test.php b/cake/tests/cases/libs/model/model.test.php index 077655634..896ad0899 100644 --- a/cake/tests/cases/libs/model/model.test.php +++ b/cake/tests/cases/libs/model/model.test.php @@ -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 (