Skip to content

Commit

Permalink
Fix failing tests.
Browse files Browse the repository at this point in the history
I have no idea why the updated session test was expected to fail as the
data was written to the session.

Refs #3551
  • Loading branch information
markstory committed Jan 22, 2013
1 parent 7549570 commit 0cdef75
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
Expand Up @@ -205,7 +205,7 @@ public function testSessionReadWrite() {
$this->assertEquals($Session->read('Test'), $array);
$Session->delete('Test');

$this->assertFalse($Session->write(array('Test'), 'some value'));
$this->assertTrue($Session->write(array('Test'), 'some value'));
$this->assertTrue($Session->write(array('Test' => 'some value')));
$this->assertEquals('some value', $Session->read('Test'));
$Session->delete('Test');
Expand Down
3 changes: 3 additions & 0 deletions lib/Cake/Test/Case/Utility/HashTest.php
Expand Up @@ -175,6 +175,9 @@ public function testGet() {
$result = Hash::get($data, '0');
$this->assertEquals('abc', $result);

$result = Hash::get($data, 0);
$this->assertEquals('abc', $result);

$result = Hash::get($data, '1');
$this->assertEquals('def', $result);

Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/Utility/Hash.php
Expand Up @@ -42,7 +42,7 @@ public static function get(array $data, $path) {
if (empty($data)) {
return null;
}
if (is_string($path)) {
if (is_string($path) || is_numeric($path)) {
$parts = explode('.', $path);
} else {
$parts = $path;
Expand Down

0 comments on commit 0cdef75

Please sign in to comment.