Permalink
Browse files

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

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

0 comments on commit d6bf0dc

Please sign in to comment.