Inheritance: extends Plank\Mediable\Exceptions\MediaUploadException
 public function test_it_returns_a_413_for_too_big_file()
 {
     $e = (new SampleExceptionHandler())->render(FileSizeException::fileIsTooBig(3, 2));
     $this->assertHttpException($e, 413);
 }
Example #2
0
 /**
  * Verify that the file being uploaded is not larger than the maximum.
  * @param  int $size
  * @return int
  * @throws \Plank\Mediable\Exceptions\MediaUpload\FileSizeException If the file is too large
  */
 private function verifyFileSize($size)
 {
     $max = $this->config['max_size'];
     if ($max > 0 && $size > $max) {
         throw FileSizeException::fileIsTooBig($size, $max);
     }
     return $size;
 }