Adding tests for HABTM unique key, disproves #3859

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6887 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
nate 2008-05-15 07:08:16 +00:00
parent bf107d1886
commit 68234dd529
2 changed files with 6 additions and 1 deletions

View file

@ -190,6 +190,11 @@ class ModelTest extends CakeTestCase {
$this->assertEqual($result, $expected);
}
function testHabtmUniqueKey() {
$model =& new Item();
$this->assertFalse($model->hasAndBelongsToMany['Portfolio']['unique']);
}
function testHasManyLimitOptimization() {
$this->loadFixtures('Project', 'Thread', 'Message', 'Bid');
$Project =& new Project();

View file

@ -447,7 +447,7 @@ class Portfolio extends CakeTestModel {
class Item extends CakeTestModel {
var $name = 'Item';
var $belongsTo = array('Syfile' => array('counterCache' => true));
var $hasAndBelongsToMany = array('Portfolio');
var $hasAndBelongsToMany = array('Portfolio' => array('unique' => false));
}
class ItemsPortfolio extends CakeTestModel {
var $name = 'ItemsPortfolio';