public function testUpload()
 {
     $payload = new FilesystemFile(new UploadedFile($this->file, 'grumpycat.jpeg', null, null, null, true));
     $storage = new FilesystemStorage($this->directory);
     $storage->upload($payload, 'notsogrumpyanymore.jpeg');
     $finder = new Finder();
     $finder->in($this->directory)->files();
     $this->assertCount(1, $finder);
     foreach ($finder as $file) {
         $this->assertEquals($file->getFilename(), 'notsogrumpyanymore.jpeg');
         $this->assertEquals($file->getSize(), 1024);
     }
 }
 public function upload(FileInterface $file, $name, $path = null)
 {
     if (!$this->session->isStarted()) {
         throw new \RuntimeException('You need a running session in order to run the Orphanage.');
     }
     return parent::upload($file, $name, $this->getPath());
 }