mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-04-23 17:33:06 +00:00
Added additional test for View::startIfEmpty($name)
This commit is contained in:
parent
03176c6c8c
commit
d6bf0dc003
1 changed files with 18 additions and 0 deletions
|
@ -1234,6 +1234,24 @@ class ViewTest extends CakeTestCase {
|
||||||
$this->assertEquals('Block content 1', $result);
|
$this->assertEquals('Block content 1', $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test block with startIfEmpty
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function testBlockCaptureStartStartIfEmpty() {
|
||||||
|
$this->View->start('test');
|
||||||
|
echo "Block content 1";
|
||||||
|
$this->View->end();
|
||||||
|
|
||||||
|
$this->View->startIfEmpty('test');
|
||||||
|
echo "Block content 2";
|
||||||
|
$this->View->end();
|
||||||
|
|
||||||
|
$result = $this->View->fetch('test');
|
||||||
|
$this->assertEquals('Block content 1', $result);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test appending to a block with capturing output.
|
* Test appending to a block with capturing output.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Add table
Reference in a new issue