Skip to content

Commit

Permalink
Test to demonstrate issue with non-string paths in Hash::get
Browse files Browse the repository at this point in the history
  • Loading branch information
mvdriel authored and markstory committed Apr 9, 2015
1 parent 846c5f1 commit 900fd3e
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions lib/Cake/Test/Case/Utility/HashTest.php
Expand Up @@ -239,6 +239,25 @@ public function testGetInvalidPath() {
Hash::get(array('one' => 'two'), true);
}

/**
* Test testGetNonStringPath()
*
* @return void
*/
public function testGetNonStringPath() {
$result = Hash::get(array(1.1 => 'one.one'), 1.1);
$this->assertEquals('one.one', $result);

$result = Hash::get(array('1' => array('1' => 'one.one')), 1.1);
$this->assertNull($result);

$result = Hash::get(array(true => 'true'), true);
$this->assertEquals('true', $result);

$result = Hash::get(array('one' => 'two'), null, '-');
$this->assertEquals('-', $result);
}

/**
* Test dimensions.
*
Expand Down

0 comments on commit 900fd3e

Please sign in to comment.