Skip to content

Commit 2452073

Browse files
committed
Add: Hash::get() のドットアクセス
1 parent ced5036 commit 2452073

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tests/Cake/Utility/HashTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,9 +318,15 @@ function testExpand() {
318318
$this->assertSame($ex, Hash::expand($arr));
319319
}
320320

321+
/**
322+
* ドット区切りでアクセス。
323+
* 設定ファイルやコンテナに使える。
324+
*/
321325
function testGet() {
322326
$arr = $this->getRecords();
323327
$this->assertSame($arr[2], Hash::get($arr, 2));
328+
329+
$this->assertSame('akane', Hash::get($arr, '2.firstName'));
324330
}
325331

326332
function testNumeric() {

0 commit comments

Comments
 (0)