File tree Expand file tree Collapse file tree 1 file changed +28
-2
lines changed Expand file tree Collapse file tree 1 file changed +28
-2
lines changed Original file line number Diff line number Diff line change @@ -4112,14 +4112,40 @@ public function testJsonSerialize($collection)
4112
4112
*/
4113
4113
public function testCombineWithArray ($ collection )
4114
4114
{
4115
+ $ c = new $ collection ([1 , 2 , 3 ]);
4116
+ $ actual = $ c ->combine ([4 , 5 , 6 ])->toArray ();
4115
4117
$ expected = [
4116
4118
1 => 4 ,
4117
4119
2 => 5 ,
4118
4120
3 => 6 ,
4119
4121
];
4120
4122
4121
- $ c = new $ collection (array_keys ($ expected ));
4122
- $ actual = $ c ->combine (array_values ($ expected ))->toArray ();
4123
+ $ this ->assertSame ($ expected , $ actual );
4124
+
4125
+ $ c = new $ collection (['name ' , 'family ' ]);
4126
+ $ actual = $ c ->combine ([1 => 'taylor ' , 2 => 'otwell ' ])->toArray ();
4127
+ $ expected = [
4128
+ 'name ' => 'taylor ' ,
4129
+ 'family ' => 'otwell ' ,
4130
+ ];
4131
+
4132
+ $ this ->assertSame ($ expected , $ actual );
4133
+
4134
+ $ c = new $ collection ([1 => 'name ' , 2 => 'family ' ]);
4135
+ $ actual = $ c ->combine (['taylor ' , 'otwell ' ])->toArray ();
4136
+ $ expected = [
4137
+ 'name ' => 'taylor ' ,
4138
+ 'family ' => 'otwell ' ,
4139
+ ];
4140
+
4141
+ $ this ->assertSame ($ expected , $ actual );
4142
+
4143
+ $ c = new $ collection ([1 => 'name ' , 2 => 'family ' ]);
4144
+ $ actual = $ c ->combine ([2 => 'taylor ' , 3 => 'otwell ' ])->toArray ();
4145
+ $ expected = [
4146
+ 'name ' => 'taylor ' ,
4147
+ 'family ' => 'otwell ' ,
4148
+ ];
4123
4149
4124
4150
$ this ->assertSame ($ expected , $ actual );
4125
4151
}
You can’t perform that action at this time.
0 commit comments