mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
View::get() default param test
This commit is contained in:
parent
0c3197a435
commit
50ad043092
1 changed files with 17 additions and 1 deletions
|
@ -1660,7 +1660,7 @@ TEXT;
|
|||
}
|
||||
|
||||
/**
|
||||
* Tests that a vew block uses default value when not assigned and uses assigned value when it is
|
||||
* Tests that a view block uses default value when not assigned and uses assigned value when it is
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
|
@ -1674,4 +1674,20 @@ TEXT;
|
|||
$result = $this->View->fetch('title', $default);
|
||||
$this->assertEquals($expected, $result);
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests that a view variable uses default value when not assigned and uses assigned value when it is
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testViewVarDefaultValue() {
|
||||
$default = 'Default';
|
||||
$result = $this->View->get('title', $default);
|
||||
$this->assertEquals($default, $result);
|
||||
|
||||
$expected = 'Back to the Future';
|
||||
$this->View->set('title', $expected);
|
||||
$result = $this->View->get('title', $default);
|
||||
$this->assertEquals($expected, $result);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue