Fixing unbalanced ob_start().

Removing dead code.
This commit is contained in:
mark_story 2010-09-19 18:55:14 -04:00
parent 92ed1e76da
commit 03d99d43be

View file

@ -918,24 +918,24 @@ class BehaviorCollectionTest extends CakeTestCase {
$this->assertIdentical($Apple->delete(4), false); $this->assertIdentical($Apple->delete(4), false);
$Apple->Behaviors->attach('Test', array('beforeDelete' => 'test2')); $Apple->Behaviors->attach('Test', array('beforeDelete' => 'test2'));
if (ob_start()) {
ob_start();
$results = $Apple->delete(4); $results = $Apple->delete(4);
$this->assertIdentical(trim(ob_get_clean()), 'beforeDelete success (cascading)'); $this->assertIdentical(trim(ob_get_clean()), 'beforeDelete success (cascading)');
$this->assertIdentical($results, true); $this->assertIdentical($results, true);
}
if (ob_start()) { ob_start();
$results = $Apple->delete(3, false); $results = $Apple->delete(3, false);
$this->assertIdentical(trim(ob_get_clean()), 'beforeDelete success'); $this->assertIdentical(trim(ob_get_clean()), 'beforeDelete success');
$this->assertIdentical($results, true); $this->assertIdentical($results, true);
}
$Apple->Behaviors->attach('Test', array('beforeDelete' => 'off', 'afterDelete' => 'on')); $Apple->Behaviors->attach('Test', array('beforeDelete' => 'off', 'afterDelete' => 'on'));
if (ob_start()) { ob_start();
$results = $Apple->delete(2, false); $results = $Apple->delete(2, false);
$this->assertIdentical(trim(ob_get_clean()), 'afterDelete success'); $this->assertIdentical(trim(ob_get_clean()), 'afterDelete success');
$this->assertIdentical($results, true); $this->assertIdentical($results, true);
} }
}
/** /**
* testBehaviorOnErrorCallback method * testBehaviorOnErrorCallback method
* *
@ -946,16 +946,10 @@ class BehaviorCollectionTest extends CakeTestCase {
$Apple = new Apple(); $Apple = new Apple();
$Apple->Behaviors->attach('Test', array('beforeFind' => 'off', 'onError' => 'on')); $Apple->Behaviors->attach('Test', array('beforeFind' => 'off', 'onError' => 'on'));
if (ob_start()) { ob_start();
$Apple->Behaviors->Test->onError($Apple); $Apple->Behaviors->Test->onError($Apple);
$this->assertIdentical(trim(ob_get_clean()), 'onError trigger success'); $this->assertIdentical(trim(ob_get_clean()), 'onError trigger success');
} }
if (ob_start()) {
$Apple->delete(99);
//$this->assertIdentical(trim(ob_get_clean()), 'onError trigger success');
}
}
/** /**
* testBehaviorValidateCallback method * testBehaviorValidateCallback method
* *