Skip to content

Commit

Permalink
Adding test case to disprove #6387
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@8176 3807eeeb-6ff5-0310-8944-8be069107fe0
  • Loading branch information
markstory committed May 22, 2009
1 parent 1910e54 commit a44e69e
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions cake/tests/cases/libs/model/model.test.php
Expand Up @@ -1823,6 +1823,24 @@ function testBindMultipleTimes() {
array('User' => array('id' => '4', 'user' => 'garrett'), 'Items' => array()));
$this->assertEqual($result, $expected);
}

/**
* test that bindModel behaves with Custom primary Key associations
*
* @return void
**/
function bindWithCustomPrimaryKey() {
$this->loadFixtures('Story', 'StoriesTag', 'Tag');
$Model =& ClassRegistry::init('StoriesTag');
$Model->bindModel(array(
'belongsTo' => array(
'Tag' => array('className' => 'Tag', 'foreignKey' => 'story')
)
));
$result = $Model->find('all');
$this->assertFalse(empty($result));
}

/**
* test find('count') method
*
Expand Down

0 comments on commit a44e69e

Please sign in to comment.