I have this function in laravel 5.1
{
if ($request->ajax()) {
if(!in_array($loc, config('loc.available'))) {
return response()->json([
'status' => 'ERROR',
'message' => 'Not available loc'
]);
}
Session::put('loc', $loc);
return response()->json([
'status' => 'OK',
'loc' => $loc,
]);
}
how to write mock test for this function to get passing ?
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire