mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Fix failing test.
This commit is contained in:
parent
beced84d2d
commit
9a67a70703
1 changed files with 6 additions and 8 deletions
|
@ -208,11 +208,11 @@ class ModelIntegrationTest extends BaseModelTest {
|
|||
public function testDynamicBehaviorAttachment() {
|
||||
$this->loadFixtures('Apple', 'Sample', 'Author');
|
||||
$TestModel = new Apple();
|
||||
$this->assertEquals($TestModel->Behaviors->attached(), array());
|
||||
$this->assertEquals(array(), $TestModel->Behaviors->attached());
|
||||
|
||||
$TestModel->Behaviors->attach('Tree', array('left' => 'left_field', 'right' => 'right_field'));
|
||||
$this->assertTrue(is_object($TestModel->Behaviors->Tree));
|
||||
$this->assertEquals($TestModel->Behaviors->attached(), array('Tree'));
|
||||
$this->assertEquals(array('Tree'), $TestModel->Behaviors->attached());
|
||||
|
||||
$expected = array(
|
||||
'parent' => 'parent_id',
|
||||
|
@ -223,16 +223,14 @@ class ModelIntegrationTest extends BaseModelTest {
|
|||
'__parentChange' => false,
|
||||
'recursive' => -1
|
||||
);
|
||||
$this->assertEquals($expected, $TestModel->Behaviors->Tree->settings['Apple']);
|
||||
|
||||
$this->assertEquals($TestModel->Behaviors->Tree->settings['Apple'], $expected);
|
||||
|
||||
$expected['enabled'] = false;
|
||||
$TestModel->Behaviors->attach('Tree', array('enabled' => false));
|
||||
$this->assertEquals($TestModel->Behaviors->Tree->settings['Apple'], $expected);
|
||||
$this->assertEquals($TestModel->Behaviors->attached(), array('Tree'));
|
||||
$this->assertEquals($expected, $TestModel->Behaviors->Tree->settings['Apple']);
|
||||
$this->assertEquals(array('Tree'), $TestModel->Behaviors->attached());
|
||||
|
||||
$TestModel->Behaviors->detach('Tree');
|
||||
$this->assertEquals($TestModel->Behaviors->attached(), array());
|
||||
$this->assertEquals(array(), $TestModel->Behaviors->attached());
|
||||
$this->assertFalse(isset($TestModel->Behaviors->Tree));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue