mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Test to demonstrate issue with non-string paths in Hash::get
This commit is contained in:
parent
846c5f13ad
commit
900fd3e7e5
1 changed files with 19 additions and 0 deletions
|
@ -239,6 +239,25 @@ class HashTest extends CakeTestCase {
|
|||
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.
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue