mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 17:16:18 +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,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
|
||||||
*
|
*
|
||||||
|
|
Loading…
Add table
Reference in a new issue