diff --git a/cake/tests/cases/libs/model/model.test.php b/cake/tests/cases/libs/model/model.test.php index d9f702de6..cdf931310 100644 --- a/cake/tests/cases/libs/model/model.test.php +++ b/cake/tests/cases/libs/model/model.test.php @@ -1823,6 +1823,24 @@ class ModelTest extends CakeTestCase { 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 *