Permalink
Browse files

Adding a test that fails for ticket #1762

Signed-off-by: mark_story <mark@mark-story.com>
  • Loading branch information...
1 parent 73a6ebe commit 95b275dc3b279a665666e0c0c9f9557691d823b3 Daniel Feinberg committed with markstory Aug 31, 2011
Showing with 16 additions and 1 deletion.
  1. +16 −1 cake/tests/cases/libs/model/behaviors/containable.test.php
@@ -36,7 +36,7 @@ class ContainableBehaviorTest extends CakeTestCase {
*/
var $fixtures = array(
'core.article', 'core.article_featured', 'core.article_featureds_tags', 'core.articles_tag', 'core.attachment', 'core.category',
- 'core.comment', 'core.featured', 'core.tag', 'core.user'
+ 'core.comment', 'core.featured', 'core.tag', 'core.user', 'core.join_a', 'core.join_b', 'core.join_c', 'core.join_a_c', 'core.join_a_b'
);
/**
@@ -3406,6 +3406,21 @@ function testResetAddedAssociation() {
$this->assertEqual($expected, array_keys($result));
$this->assertTrue(empty($this->Article->hasMany['ArticlesTag']));
+
+ $this->JoinA =& ClassRegistry::init('JoinA');
+ $this->JoinB =& ClassRegistry::init('JoinB');
+ $this->JoinC =& ClassRegistry::init('JoinC');
+
+ $this->JoinA->Behaviors->attach('Containable');
+ $this->JoinB->Behaviors->attach('Containable');
+ $this->JoinC->Behaviors->attach('Containable');
+
+ $this->JoinA->JoinB->find('all', array('contain' => array('JoinA')));
+ $this->JoinA->bindModel(array('hasOne' => array('JoinAsJoinC' => array('joinTable' => 'as_cs'))), false);
+ $result = $this->JoinA->hasOne;
+ $this->JoinA->find('all');
+ $resultAfter = $this->JoinA->hasOne;
+ $this->assertEqual($result, $resultAfter);
}
/**

0 comments on commit 95b275d

Please sign in to comment.