Fixed failing tests

Fixed syntax error in french translations.
Removed 'required' on image validation which was breaking tests
This commit is contained in:
Dan Brown 2018-03-24 15:25:13 +00:00
parent 5ad9c5d319
commit 3df7d828eb
No known key found for this signature in database
GPG Key ID: 46D9F943C24A2EF9
3 changed files with 4 additions and 3 deletions

View File

@ -120,7 +120,7 @@ class ImageController extends Controller
{ {
$this->checkPermission('image-create-all'); $this->checkPermission('image-create-all');
$this->validate($request, [ $this->validate($request, [
'file' => 'required|image' 'file' => 'is_image'
]); ]);
if (!$this->imageRepo->isValidType($type)) { if (!$this->imageRepo->isValidType($type)) {
@ -136,6 +136,7 @@ class ImageController extends Controller
return response($e->getMessage(), 500); return response($e->getMessage(), 500);
} }
return response()->json($image); return response()->json($image);
} }

View File

@ -15,7 +15,7 @@ class AppServiceProvider extends ServiceProvider
public function boot() public function boot()
{ {
// Custom validation methods // Custom validation methods
Validator::extend('image', function ($attribute, $value, $parameters, $validator) { Validator::extend('is_image', function ($attribute, $value, $parameters, $validator) {
$imageMimes = ['image/png', 'image/bmp', 'image/gif', 'image/jpeg', 'image/jpg', 'image/tiff', 'image/webp']; $imageMimes = ['image/png', 'image/bmp', 'image/gif', 'image/jpeg', 'image/jpg', 'image/tiff', 'image/webp'];
return in_array($value->getMimeType(), $imageMimes); return in_array($value->getMimeType(), $imageMimes);
}); });

View File

@ -63,7 +63,7 @@ return [
'search_created_before' => 'Créé avant', 'search_created_before' => 'Créé avant',
'search_created_after' => 'Créé après', 'search_created_after' => 'Créé après',
'search_set_date' => 'Choisir la date', 'search_set_date' => 'Choisir la date',
'search_update' => 'Actualiser la recherche' 'search_update' => 'Actualiser la recherche',
/** /**
* Books * Books