mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-03-15 05:59:50 +00:00
Making BehaviorCollection more consistent with other object collections.
Fixing failing tests caused by not being updated when behavior changed.
This commit is contained in:
parent
cb657b158b
commit
8aabf3689e
2 changed files with 4 additions and 4 deletions
|
@ -64,8 +64,8 @@ class BehaviorCollection extends ObjectCollection {
|
|||
$this->modelName = $modelName;
|
||||
|
||||
if (!empty($behaviors)) {
|
||||
foreach (Set::normalize($behaviors) as $behavior => $config) {
|
||||
$this->load($behavior, $config);
|
||||
foreach (BehaviorCollection::normalizeObjectArray($behaviors) as $behavior => $config) {
|
||||
$this->load($config['class'], $config['settings']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1309,12 +1309,12 @@ class ModelIntegrationTest extends BaseModelTest {
|
|||
$this->loadFixtures('Post');
|
||||
|
||||
$TestModel = ClassRegistry::init('MergeVarPluginPost');
|
||||
$this->assertEqual($TestModel->actsAs, array('Containable', 'Tree'));
|
||||
$this->assertEqual($TestModel->actsAs, array('Containable' => null, 'Tree' => null));
|
||||
$this->assertTrue(isset($TestModel->Behaviors->Containable));
|
||||
$this->assertTrue(isset($TestModel->Behaviors->Tree));
|
||||
|
||||
$TestModel = ClassRegistry::init('MergeVarPluginComment');
|
||||
$expected = array('Containable', 'Containable' => array('some_settings'));
|
||||
$expected = array('Containable' => array('some_settings'));
|
||||
$this->assertEqual($TestModel->actsAs, $expected);
|
||||
$this->assertTrue(isset($TestModel->Behaviors->Containable));
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue