-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from bluemorbo/fix-entities-with-scalar-arrays
Fix handling of scalar arrays
- Loading branch information
Showing
3 changed files
with
21 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,6 +64,17 @@ public function can_serialize_nested_arrays() | |
$this->assertEquals('Jane', $this->entity->contacts[1]->name); | ||
} | ||
|
||
/** | ||
* @test | ||
*/ | ||
public function does_not_serialize_nested_scalar_values() | ||
{ | ||
$this->loadSampleEntity(); | ||
|
||
$this->assertSame("Mr Jack Doe", $this->entity->aliases[0]); | ||
$this->assertSame("Mr J Doe", $this->entity->aliases[1]); | ||
} | ||
|
||
protected function loadSampleEntity() | ||
{ | ||
$this->entity = new Entity([ | ||
|
@@ -82,6 +93,10 @@ protected function loadSampleEntity() | |
'name' => 'Jane', | ||
'email' => '[email protected]', | ||
] | ||
], | ||
'aliases' => [ | ||
'Mr Jack Doe', | ||
'Mr J Doe' | ||
] | ||
]); | ||
} | ||
|