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()
48
48
$ this ->assertNull ($ this ->password );
49
49
$ this ->assertStringContainsString ('test ' , $ this ->next );
50
50
}
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
+ }
51
66
}
Original file line number Diff line number Diff line change @@ -51,8 +51,8 @@ public function testMappingIgnoresDifferentTypes()
51
51
52
52
$ this ->attributesToProperties ($ model );
53
53
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 ));
56
56
57
57
$ this ->assertInstanceOf (\Closure::class, $ this ->default );
58
58
$ this ->assertTrue (($ this ->default )());
You can’t perform that action at this time.
0 commit comments