This repository was archived by the owner on Mar 12, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -48,4 +48,19 @@ public function testCanMapAnArrayRecursively()
4848 $ this ->assertNull ($ this ->password );
4949 $ this ->assertStringContainsString ('test ' , $ this ->next );
5050 }
51+
52+ /** @test */
53+ public function testAlreadyInitializedPropertiesArentOverridesByNestedArrays ()
54+ {
55+ $ array = [
56+ 'name ' => 'Michael Rubel ' ,
57+ 'additional_data ' => [
58+ 'name ' => 'test ' ,
59+ ],
60+ ];
61+
62+ $ this ->arrayToProperties ($ array );
63+
64+ $ this ->assertStringContainsString ('Michael ' , $ this ->name );
65+ }
5166}
Original file line number Diff line number Diff line change @@ -51,8 +51,8 @@ public function testMappingIgnoresDifferentTypes()
5151
5252 $ this ->attributesToProperties ($ model );
5353
54- $ this ->assertFalse (( new \ ReflectionProperty ( $ this , ' name ' ))-> isInitialized ( $ this ));
55- $ this ->assertFalse (( new \ ReflectionProperty ( $ this , ' files ' ))-> isInitialized ( $ this ));
54+ $ this ->assertFalse (isset ( $ this -> name ));
55+ $ this ->assertFalse (isset ( $ this -> files ));
5656
5757 $ this ->assertInstanceOf (\Closure::class, $ this ->default );
5858 $ this ->assertTrue (($ this ->default )());
You can’t perform that action at this time.
0 commit comments