diff --git a/src/Api/Controllers/UploadTopImageController.php b/src/Api/Controllers/UploadTopImageController.php index 364e95f..8c4fec4 100755 --- a/src/Api/Controllers/UploadTopImageController.php +++ b/src/Api/Controllers/UploadTopImageController.php @@ -71,7 +71,6 @@ public function data(ServerRequestInterface $request, Document $document) if (!$file instanceof UploadedFile) { if (is_array($file)) { $file = Arr::first($file); - } else { throw new ValidationException(['file' => 'Not an UploadFile instance']); } @@ -82,7 +81,7 @@ public function data(ServerRequestInterface $request, Document $document) switch ($id) { case 1: - $size = 150;; + $size = 150; break; case 2: $size = 125; diff --git a/tests/EnhancedTestCase.php b/tests/EnhancedTestCase.php index 4c3dc56..f748a15 100644 --- a/tests/EnhancedTestCase.php +++ b/tests/EnhancedTestCase.php @@ -1,5 +1,14 @@ prepareDatabase([ 'users' => [ $this->normalUser(), - ] - ]); + ], + ]); } public function topImagesProvider() @@ -33,6 +42,7 @@ public function topImagesProvider() /** * @dataProvider topImagesProvider + * * @test */ public function normal_user_cannot_upload_top_image(int $imageNo) @@ -52,6 +62,7 @@ public function normal_user_cannot_upload_top_image(int $imageNo) /** * @dataProvider topImagesProvider + * * @test */ public function admin_can_upload_top_image(int $imageNo) diff --git a/tests/integration/setup.php b/tests/integration/setup.php index 67039c0..b8020e3 100644 --- a/tests/integration/setup.php +++ b/tests/integration/setup.php @@ -1,10 +1,12 @@