mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Added test case
This commit is contained in:
parent
7edcdb0799
commit
b0e5e39e45
2 changed files with 7 additions and 2 deletions
|
@ -1617,10 +1617,12 @@ class ModelIntegrationTest extends BaseModelTest {
|
|||
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'
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue