mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Added test case for view block default value
This commit is contained in:
parent
6d98069f13
commit
f1a344eee4
1 changed files with 17 additions and 1 deletions
|
@ -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);
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue