@@ -1052,6 +1052,17 @@ public function testWhere($collection)
1052
1052
[['v ' => 1 ], ['v ' => 2 ]],
1053
1053
$ c ->where ('v ' )->values ()->all ()
1054
1054
);
1055
+
1056
+ $ c = new $ collection ([
1057
+ ['v ' => 1 , 'g ' => 3 ],
1058
+ ['v ' => 2 , 'g ' => 2 ],
1059
+ ['v ' => 2 , 'g ' => 3 ],
1060
+ ['v ' => 2 , 'g ' => null ],
1061
+ ]);
1062
+ $ this ->assertEquals ([['v ' => 2 , 'g ' => 3 ]], $ c ->where ('v ' , 2 )->where ('g ' , 3 )->values ()->all ());
1063
+ $ this ->assertEquals ([['v ' => 2 , 'g ' => 3 ]], $ c ->where ('v ' , 2 )->where ('g ' , '> ' , 2 )->values ()->all ());
1064
+ $ this ->assertEquals ([], $ c ->where ('v ' , 2 )->where ('g ' , 4 )->values ()->all ());
1065
+ $ this ->assertEquals ([['v ' => 2 , 'g ' => null ]], $ c ->where ('v ' , 2 )->whereNull ('g ' )->values ()->all ());
1055
1066
}
1056
1067
1057
1068
/**
@@ -1085,6 +1096,8 @@ public function testWhereIn($collection)
1085
1096
{
1086
1097
$ c = new $ collection ([['v ' => 1 ], ['v ' => 2 ], ['v ' => 3 ], ['v ' => '3 ' ], ['v ' => 4 ]]);
1087
1098
$ this ->assertEquals ([['v ' => 1 ], ['v ' => 3 ], ['v ' => '3 ' ]], $ c ->whereIn ('v ' , [1 , 3 ])->values ()->all ());
1099
+ $ this ->assertEquals ([], $ c ->whereIn ('v ' , [2 ])->whereIn ('v ' , [1 , 3 ])->values ()->all ());
1100
+ $ this ->assertEquals ([['v ' => 1 ]], $ c ->whereIn ('v ' , [1 ])->whereIn ('v ' , [1 , 3 ])->values ()->all ());
1088
1101
}
1089
1102
1090
1103
/**
@@ -1103,6 +1116,7 @@ public function testWhereNotIn($collection)
1103
1116
{
1104
1117
$ c = new $ collection ([['v ' => 1 ], ['v ' => 2 ], ['v ' => 3 ], ['v ' => '3 ' ], ['v ' => 4 ]]);
1105
1118
$ this ->assertEquals ([['v ' => 2 ], ['v ' => 4 ]], $ c ->whereNotIn ('v ' , [1 , 3 ])->values ()->all ());
1119
+ $ this ->assertEquals ([['v ' => 4 ]], $ c ->whereNotIn ('v ' , [2 ])->whereNotIn ('v ' , [1 , 3 ])->values ()->all ());
1106
1120
}
1107
1121
1108
1122
/**
0 commit comments