Наследование: extends Plank\Mediable\Exceptions\MediaUploadException
 public function test_it_returns_a_415_for_restricted_aggregate_type()
 {
     $e = (new SampleExceptionHandler())->render(FileNotSupportedException::aggregateTypeRestricted('foo', ['bar']));
     $this->assertHttpException($e, 415);
 }
Пример #2
0
 /**
  * Ensure that the file's extension is allowed.
  * @param  string $extension
  * @return string
  * @throws \Plank\Mediable\Exceptions\MediaUpload\FileNotSupportedException If the file extension is not allowed
  */
 private function verifyExtension($extension)
 {
     $allowed = $this->config['allowed_extensions'];
     if (!empty($allowed) && !in_array($extension, $allowed)) {
         throw FileNotSupportedException::extensionRestricted($extension, $allowed);
     }
     return $extension;
 }