public function testWrongFileDirectoryParam() { try { $this->assertEquals('/tests', Path::getFileDirectory(array())); } catch (\Exception $exception) { $this->assertInstanceOf('\\Vegas\\Utils\\Path\\Exception\\InvalidPathException', $exception); } }
public function register(DiInterface $di) { $config = $di->get('config'); $di->set(self::SERVICE_NAME, function () use($config) { $uploaderAdapter = new Uploader(new \Foo\Models\Fake()); $uploaderAdapter->setExtensions(['jpg', 'png']); $uploaderAdapter->setMimeTypes(['image/jpeg', 'image/png']); $uploaderAdapter->setMaxFileSize('10MB'); $uploaderAdapter->setTempDestination(\Vegas\Utils\Path::getRootPath() . '/public/temp'); $uploaderAdapter->setOriginalDestination(\Vegas\Utils\Path::getRootPath() . '/public/uploads'); return $uploaderAdapter; }, true); }
/** * @param int $width * @param int $height * @return mixed|string */ public function getThumbnailUrl($width = 168, $height = 120) { return Path::getRelativePath($this->getThumbnailPath($width, $height)); }