mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
Fixing unbalanced ob_start().
Removing dead code.
This commit is contained in:
parent
92ed1e76da
commit
03d99d43be
1 changed files with 18 additions and 24 deletions
|
@ -918,23 +918,23 @@ class BehaviorCollectionTest extends CakeTestCase {
|
|||
$this->assertIdentical($Apple->delete(4), false);
|
||||
|
||||
$Apple->Behaviors->attach('Test', array('beforeDelete' => 'test2'));
|
||||
if (ob_start()) {
|
||||
$results = $Apple->delete(4);
|
||||
$this->assertIdentical(trim(ob_get_clean()), 'beforeDelete success (cascading)');
|
||||
$this->assertIdentical($results, true);
|
||||
}
|
||||
if (ob_start()) {
|
||||
$results = $Apple->delete(3, false);
|
||||
$this->assertIdentical(trim(ob_get_clean()), 'beforeDelete success');
|
||||
$this->assertIdentical($results, true);
|
||||
}
|
||||
|
||||
ob_start();
|
||||
$results = $Apple->delete(4);
|
||||
$this->assertIdentical(trim(ob_get_clean()), 'beforeDelete success (cascading)');
|
||||
$this->assertIdentical($results, true);
|
||||
|
||||
ob_start();
|
||||
$results = $Apple->delete(3, false);
|
||||
$this->assertIdentical(trim(ob_get_clean()), 'beforeDelete success');
|
||||
$this->assertIdentical($results, true);
|
||||
|
||||
|
||||
$Apple->Behaviors->attach('Test', array('beforeDelete' => 'off', 'afterDelete' => 'on'));
|
||||
if (ob_start()) {
|
||||
$results = $Apple->delete(2, false);
|
||||
$this->assertIdentical(trim(ob_get_clean()), 'afterDelete success');
|
||||
$this->assertIdentical($results, true);
|
||||
}
|
||||
ob_start();
|
||||
$results = $Apple->delete(2, false);
|
||||
$this->assertIdentical(trim(ob_get_clean()), 'afterDelete success');
|
||||
$this->assertIdentical($results, true);
|
||||
}
|
||||
/**
|
||||
* testBehaviorOnErrorCallback method
|
||||
|
@ -946,15 +946,9 @@ class BehaviorCollectionTest extends CakeTestCase {
|
|||
$Apple = new Apple();
|
||||
|
||||
$Apple->Behaviors->attach('Test', array('beforeFind' => 'off', 'onError' => 'on'));
|
||||
if (ob_start()) {
|
||||
$Apple->Behaviors->Test->onError($Apple);
|
||||
$this->assertIdentical(trim(ob_get_clean()), 'onError trigger success');
|
||||
}
|
||||
|
||||
if (ob_start()) {
|
||||
$Apple->delete(99);
|
||||
//$this->assertIdentical(trim(ob_get_clean()), 'onError trigger success');
|
||||
}
|
||||
ob_start();
|
||||
$Apple->Behaviors->Test->onError($Apple);
|
||||
$this->assertIdentical(trim(ob_get_clean()), 'onError trigger success');
|
||||
}
|
||||
/**
|
||||
* testBehaviorValidateCallback method
|
||||
|
|
Loading…
Add table
Reference in a new issue