public static function mimeRestricted($mime, $allowed_mimes) { $allowed = implode('`, `', $allowed_mimes); return new static("Cannot upload file with MIME type `{$mime}`. Only the `{$allowed}` MIME type(s) are permitted."); }
public function test_it_returns_a_415_for_restricted_type() { $e = (new SampleExceptionHandler())->render(FileNotSupportedException::mimeRestricted('text/foo', ['text/bar'])); $this->assertHttpException($e, 415); }