Adding test case to disprove #6387

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@8176 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
mark_story 2009-05-22 02:00:21 +00:00
parent 1910e5482b
commit a44e69e47f

View file

@ -1823,6 +1823,24 @@ class ModelTest extends CakeTestCase {
array('User' => array('id' => '4', 'user' => 'garrett'), 'Items' => array())); array('User' => array('id' => '4', 'user' => 'garrett'), 'Items' => array()));
$this->assertEqual($result, $expected); $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 * test find('count') method
* *