Permalink
Browse files

Fix failing test.

  • Loading branch information...
markstory committed Jan 8, 2012
1 parent beced84 commit 9a67a7070383abe3d746c9f71e386a10e9548863
Showing with 6 additions and 8 deletions.
  1. +6 −8 lib/Cake/Test/Case/Model/ModelIntegrationTest.php
@@ -208,11 +208,11 @@ public function testPkInHabtmLinkModel() {
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 @@ public function testDynamicBehaviorAttachment() {
'__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));
}

0 comments on commit 9a67a70

Please sign in to comment.