Skip to content

Commit a235700

Browse files
committed
Add test for multiple level nested dot notation
1 parent ebab4eb commit a235700

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tests/ModelTest.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -495,6 +495,22 @@ public function testDotNotation()
495495
$this->assertEquals('Strasbourg', $user['address.city']);
496496
}
497497

498+
public function testMultipleLevelDotNotation()
499+
{
500+
$book = Book::create([
501+
'title' => 'A Game of Thrones',
502+
'chapters' => [
503+
'one' => [
504+
'title' => 'The first chapter',
505+
],
506+
],
507+
]);
508+
509+
$this->assertEquals(['one' => ['title' => 'The first chapter']], $book->chapters);
510+
$this->assertEquals(['title' => 'The first chapter'], $book['chapters.one']);
511+
$this->assertEquals('The first chapter', $book['chapters.one.title']);
512+
}
513+
498514
public function testGetDirtyDates()
499515
{
500516
$user = new User();

0 commit comments

Comments
 (0)