Permalink
Browse files

Added test for View::startIfEmpty($name)

  • Loading branch information...
1 parent 43d766f commit 03176c6c8c7921162d862d8808ecd97d8f3e17f1 @LiquidityC LiquidityC committed with LiquidityC Oct 30, 2012
Showing with 18 additions and 0 deletions.
  1. +18 −0 lib/Cake/Test/Case/View/ViewTest.php
View
18 lib/Cake/Test/Case/View/ViewTest.php
@@ -1217,6 +1217,24 @@ public function testBlockCapture() {
}
/**
+ * 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.
*
* @return void

0 comments on commit 03176c6

Please sign in to comment.