mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
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:
parent
1910e5482b
commit
a44e69e47f
1 changed files with 18 additions and 0 deletions
|
@ -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
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue