Skip to content
Permalink
Browse files

Added test for View::startIfEmpty($name)

  • Loading branch information...
Linus Probert authored and LiquidityC committed Oct 30, 2012
1 parent 43d766f commit 03176c6c8c7921162d862d8808ecd97d8f3e17f1
Showing with 18 additions and 0 deletions.
  1. +18 −0 lib/Cake/Test/Case/View/ViewTest.php
@@ -1216,6 +1216,24 @@ public function testBlockCapture() {
$this->assertEquals('Block content', $result);
}
/**
* Test block with startIfEmpty
*
* @return void
*/
public function testBlockCaptureStartIfEmpty() {
$this->View->startIfEmpty('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.
*

0 comments on commit 03176c6

Please sign in to comment.
You can’t perform that action at this time.