Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added test case for view block default value

  • Loading branch information...
commit f1a344eee4b8bcfdba69ecc87fe09c86f7c87bd9 1 parent 6d98069
@tigrang tigrang authored
Showing with 17 additions and 1 deletion.
  1. +17 −1 lib/Cake/Test/Case/View/ViewTest.php
View
18 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);
+ }
+}
Please sign in to comment.
Something went wrong with that request. Please try again.