Inheritance: use trait Webiny\Component\StdLib\StdLibTrait
Example #1
0
 /**
  * Get the File object for the given $name.
  * If you have a multi-dimensional upload field name, than you should pass the optional $arrayOffset param to get the
  * right File object.
  *
  * @param string   $name        Name of the upload field.
  * @param null|int $arrayOffset Optional array offset for multi-dimensional upload fields.
  *
  * @throws \Exception|Request\Files\FilesException
  * @return Files\File
  */
 public function files($name, $arrayOffset = null)
 {
     try {
         return $this->files->get($name, $arrayOffset);
     } catch (Files\FilesException $e) {
         throw $e;
     }
 }
Example #2
0
 public function testGetSize()
 {
     $files = new Files();
     $testFile = $files->get("test_file");
     $this->assertSame("2048", $testFile->getSize());
 }
Example #3
0
 /**
  * @expectedException \Webiny\Component\Http\Request\Files\FilesException
  */
 public function testGetException()
 {
     $files = new Files();
     $files->get("doesnt_exit");
 }