Skip to content
Permalink
Browse files

Added test case for view block default value

  • Loading branch information...
tigrang committed Sep 13, 2012
1 parent 6d98069 commit f1a344eee4b8bcfdba69ecc87fe09c86f7c87bd9
Showing with 17 additions and 1 deletion.
  1. +17 −1 lib/Cake/Test/Case/View/ViewTest.php
@@ -1445,4 +1445,20 @@ public function testMemoryLeakInPaths() {
$end = memory_get_usage();
$this->assertLessThanOrEqual($start + 5000, $end);
}
}
/**
* tests that a vew block uses default value when not assigned and uses assigned value when it is
*
* @return void
*/
public function testBlockDefaultValue() {
$default = 'Default';
$result = $this->View->fetch('title', $default);
$this->assertEqual($result, $default);
$expected = 'My Title';
$this->View->assign('title', $expected);
$result = $this->View->fetch('title', $default);
$this->assertEqual($result, $expected);
}
}

0 comments on commit f1a344e

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