@@ -209,7 +209,7 @@ public function testExists()
209
209
$ this ->assertFalse (Arr::exists ($ array , 'four ' ));
210
210
}
211
211
212
- public function testFindKey ()
212
+ public function testSearchKey ()
213
213
{
214
214
$ array = [
215
215
'one ' => 'value 1 ' ,
@@ -221,14 +221,14 @@ public function testFindKey()
221
221
]
222
222
];
223
223
224
- $ this ->assertEquals ('one ' , Arr::findKey ($ array , 'value 1 ' ));
225
- $ this ->assertEquals ('two ' , Arr::findKey ($ array , 'value 2 ' ));
226
- $ this ->assertEquals ('three ' , Arr::findKey ($ array , 'value 3 ' ));
224
+ $ this ->assertEquals ('one ' , Arr::searchKey ($ array , 'value 1 ' ));
225
+ $ this ->assertEquals ('two ' , Arr::searchKey ($ array , 'value 2 ' ));
226
+ $ this ->assertEquals ('three ' , Arr::searchKey ($ array , 'value 3 ' ));
227
227
228
- $ this ->assertFalse (Arr::findKey ($ array , 'four ' ));
228
+ $ this ->assertFalse (Arr::searchKey ($ array , 'four ' ));
229
229
}
230
230
231
- public function testFindKeyCallable ()
231
+ public function testSearchKeyCallable ()
232
232
{
233
233
$ array = [
234
234
'one ' => 'value 1 ' ,
@@ -240,14 +240,14 @@ public function testFindKeyCallable()
240
240
]
241
241
];
242
242
243
- $ this ->assertEquals ('one ' , Arr::findKey ($ array , function ($ item ) { return $ item === 'value 1 ' ;}));
244
- $ this ->assertEquals ('two ' , Arr::findKey ($ array , function ($ item ) { return $ item === 'value 2 ' ;}));
245
- $ this ->assertEquals ('three ' , Arr::findKey ($ array , function ($ item ) { return $ item === 'value 3 ' ;}));
243
+ $ this ->assertEquals ('one ' , Arr::searchKey ($ array , function ($ item ) { return $ item === 'value 1 ' ;}));
244
+ $ this ->assertEquals ('two ' , Arr::searchKey ($ array , function ($ item ) { return $ item === 'value 2 ' ;}));
245
+ $ this ->assertEquals ('three ' , Arr::searchKey ($ array , function ($ item ) { return $ item === 'value 3 ' ;}));
246
246
247
- $ this ->assertFalse (Arr::findKey ($ array , function ($ item ) { return $ item === 'blah ' ;}));
247
+ $ this ->assertFalse (Arr::searchKey ($ array , function ($ item ) { return $ item === 'blah ' ;}));
248
248
}
249
249
250
- public function testFind ()
250
+ public function testSearch ()
251
251
{
252
252
$ array = [
253
253
'one ' => 'value 1 ' ,
@@ -259,14 +259,14 @@ public function testFind()
259
259
]
260
260
];
261
261
262
- $ this ->assertEquals ('value 1 ' , Arr::find ($ array , 'value 1 ' ));
263
- $ this ->assertEquals ('value 2 ' , Arr::find ($ array , 'value 2 ' ));
264
- $ this ->assertEquals ('value 3 ' , Arr::find ($ array , 'value 3 ' ));
262
+ $ this ->assertEquals ('value 1 ' , Arr::search ($ array , 'value 1 ' ));
263
+ $ this ->assertEquals ('value 2 ' , Arr::search ($ array , 'value 2 ' ));
264
+ $ this ->assertEquals ('value 3 ' , Arr::search ($ array , 'value 3 ' ));
265
265
266
- $ this ->assertNull (Arr::find ($ array , 'four ' ));
266
+ $ this ->assertNull (Arr::search ($ array , 'four ' ));
267
267
}
268
268
269
- public function testFindCallable ()
269
+ public function testSearchCallable ()
270
270
{
271
271
$ array = [
272
272
'one ' => 'value 1 ' ,
@@ -278,11 +278,11 @@ public function testFindCallable()
278
278
]
279
279
];
280
280
281
- $ this ->assertEquals ('value 1 ' , Arr::find ($ array , function ($ item , $ key ) { return $ key === 'one ' ; }));
282
- $ this ->assertEquals ('value 2 ' , Arr::find ($ array , function ($ item , $ key ) { return $ key === 'two ' ; }));
283
- $ this ->assertEquals ('value 3 ' , Arr::find ($ array , function ($ item , $ key ) { return $ key === 'three ' ; }));
281
+ $ this ->assertEquals ('value 1 ' , Arr::search ($ array , function ($ item , $ key ) { return $ key === 'one ' ; }));
282
+ $ this ->assertEquals ('value 2 ' , Arr::search ($ array , function ($ item , $ key ) { return $ key === 'two ' ; }));
283
+ $ this ->assertEquals ('value 3 ' , Arr::search ($ array , function ($ item , $ key ) { return $ key === 'three ' ; }));
284
284
285
- $ this ->assertNull (Arr::find ($ array , function ($ item , $ key ) { return $ key === 'four ' ; }));
285
+ $ this ->assertNull (Arr::search ($ array , function ($ item , $ key ) { return $ key === 'four ' ; }));
286
286
}
287
287
288
288
public function testLocate ()
0 commit comments