Added test case for view block default value

This commit is contained in:
Tigran Gabrielyan 2012-09-13 15:35:11 -07:00
parent 6d98069f13
commit f1a344eee4

View file

@ -1445,4 +1445,20 @@ TEXT;
$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);
}
}