Skip to content
Permalink
Browse files

Added test case

  • Loading branch information...
psaintjust committed Jul 10, 2016
1 parent 7edcdb0 commit b0e5e39e45faefd3762744cbd4af364f778f68b6
Showing with 7 additions and 2 deletions.
  1. +3 −1 lib/Cake/Test/Case/Model/ModelIntegrationTest.php
  2. +4 −1 lib/Cake/Test/Case/Model/models.php
@@ -1617,10 +1617,12 @@ public function testAutoConstructAssociations() {
public function testAutoConstructPluginAssociations() {
$Comment = ClassRegistry::init('TestPluginComment');
$this->assertEquals(2, count($Comment->belongsTo), 'Too many associations');
$this->assertEquals(3, count($Comment->belongsTo), 'Too many associations');
$this->assertFalse(isset($Comment->belongsTo['TestPlugin.User']));
$this->assertFalse(isset($Comment->belongsTo['TestPlugin.Source']));
$this->assertTrue(isset($Comment->belongsTo['User']), 'Missing association');
$this->assertTrue(isset($Comment->belongsTo['TestPluginArticle']), 'Missing association');
$this->assertTrue(isset($Comment->belongsTo['Source']), 'Missing association');
}
/**
@@ -2991,7 +2991,10 @@ class TestPluginComment extends CakeTestModel {
'className' => 'TestPlugin.TestPluginArticle',
'foreignKey' => 'article_id',
),
'TestPlugin.User'
'TestPlugin.User',
'TestPlugin.Source' => array(
'foreignKey' => 'source_id'
)
);
}

0 comments on commit b0e5e39

Please sign in to comment.
You can’t perform that action at this time.