Added additional test for View::startIfEmpty($name)

This commit is contained in:
Linus Probert 2012-11-18 16:30:47 +01:00
parent 03176c6c8c
commit d6bf0dc003

View file

@ -1234,6 +1234,24 @@ class ViewTest extends CakeTestCase {
$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.
*