mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-18 18:46:17 +00:00
Merge branch '2.1' into 2.2
This commit is contained in:
commit
6b045318d8
5 changed files with 40 additions and 3 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -6,4 +6,4 @@
|
|||
/build
|
||||
/dist
|
||||
.DS_Store
|
||||
tags
|
||||
/tags
|
||||
|
|
|
@ -191,7 +191,6 @@ class SessionComponentTest extends CakeTestCase {
|
|||
|
||||
$this->assertTrue($Session->write('Test', 'some value'));
|
||||
$this->assertEquals('some value', $Session->read('Test'));
|
||||
$this->assertFalse($Session->write('Test.key', 'some value'));
|
||||
$Session->delete('Test');
|
||||
|
||||
$this->assertTrue($Session->write('Test.key.path', 'some value'));
|
||||
|
|
|
@ -297,6 +297,22 @@ class CakeSessionTest extends CakeTestCase {
|
|||
$this->assertFalse(TestCakeSession::write(''));
|
||||
}
|
||||
|
||||
/**
|
||||
* Test overwriting a string value as if it were an array.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testWriteOverwriteStringValue() {
|
||||
TestCakeSession::write('Some.string', 'value');
|
||||
$this->assertEquals('value', TestCakeSession::read('Some.string'));
|
||||
|
||||
TestCakeSession::write('Some.string.array', array('values'));
|
||||
$this->assertEquals(
|
||||
array('values'),
|
||||
TestCakeSession::read('Some.string.array')
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* testId method
|
||||
*
|
||||
|
|
|
@ -1700,6 +1700,28 @@ class SetTest extends CakeTestCase {
|
|||
$this->assertEquals($expected, $result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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);
|
||||
}
|
||||
|
||||
/**
|
||||
* testRemove method
|
||||
*
|
||||
|
|
|
@ -686,7 +686,7 @@ class Set {
|
|||
$_list =& $_list[$key];
|
||||
}
|
||||
if (!is_array($_list)) {
|
||||
return array();
|
||||
$_list = array();
|
||||
}
|
||||
}
|
||||
return $list;
|
||||
|
|
Loading…
Add table
Reference in a new issue