public static function aggregateTypeRestricted($type, $allowed_types) { $allowed = implode('`, `', $allowed_types); return new static("Cannot upload file of aggregate type `{$type}`. Only files of type(s) `{$allowed}` are permitted."); }
public function test_it_returns_a_415_for_restricted_aggregate_type() { $e = (new SampleExceptionHandler())->render(FileNotSupportedException::aggregateTypeRestricted('foo', ['bar'])); $this->assertHttpException($e, 415); }