Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Added additional test for View::startIfEmpty($name)
  • Loading branch information
LiquidityC committed Nov 18, 2012
1 parent 03176c6 commit d6bf0dc
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions lib/Cake/Test/Case/View/ViewTest.php
Expand Up @@ -1234,6 +1234,24 @@ public function testBlockCaptureStartIfEmpty() {
$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.
*
Expand Down

0 comments on commit d6bf0dc

Please sign in to comment.