diff --git a/cake/tests/cases/libs/model/model.test.php b/cake/tests/cases/libs/model/model.test.php index 8dac09435..ebbc5ec20 100644 --- a/cake/tests/cases/libs/model/model.test.php +++ b/cake/tests/cases/libs/model/model.test.php @@ -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(); diff --git a/cake/tests/cases/libs/model/models.php b/cake/tests/cases/libs/model/models.php index ef89b93ff..cb818c9e2 100644 --- a/cake/tests/cases/libs/model/models.php +++ b/cake/tests/cases/libs/model/models.php @@ -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';