mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
parent
6e0e15682f
commit
c087576f20
2 changed files with 23 additions and 1 deletions
|
@ -1113,6 +1113,28 @@ class HashTest extends CakeTestCase {
|
|||
$this->assertEquals('value', $result[0]['Comment'][1]['insert']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test that insert() can insert data over a string value.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testInsertOverwriteStringValue() {
|
||||
$data = array(
|
||||
'Some' => array(
|
||||
'string' => 'value'
|
||||
)
|
||||
);
|
||||
$result = Set::insert($data, 'Some.string.value', array('values'));
|
||||
$expected = array(
|
||||
'Some' => array(
|
||||
'string' => array(
|
||||
'value' => array( 'values')
|
||||
)
|
||||
)
|
||||
);
|
||||
$this->assertEquals($expected, $result);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test remove() method.
|
||||
*
|
||||
|
|
|
@ -270,7 +270,7 @@ class Hash {
|
|||
$_list =& $_list[$key];
|
||||
}
|
||||
if (!is_array($_list)) {
|
||||
return array();
|
||||
$_list = array();
|
||||
}
|
||||
}
|
||||
if ($op === 'remove') {
|
||||
|
|
Loading…
Add table
Reference in a new issue