/** * Test write access for uploadable fields. * Autocreates the desired directory if it does not exist. * * @param array $fields * * @return array */ private function setCanUpload($fields) { $filesystem = $this->filesystem->getFilesystem('files'); foreach ($fields as &$values) { if (isset($values['upload'])) { $values['canUpload'] = ($filesystem->has($values['upload']) || $filesystem->createDir($values['upload'])) && $filesystem->getVisibility($values['upload']); } else { $values['canUpload'] = true; } } return $fields; }
protected function createResponder($saveFiles = false) { $responder = new Responder($this->creator, $this->finder, $this->errorImage, $saveFiles ? $this->fs->getFilesystem('web') : null, $this->cache); return $responder; }
public function testImageNotFoundUsesDefault() { $image = $this->finder->find('herp/derp.png'); $this->assertSame($this->fs->getFilesystem('images'), $image->getFilesystem()); $this->assertSame('samples/sample1.jpg', $image->getPath()); }