/** * Test Simondubois\UnsplashDownloader\Validate::destination() */ public function testSuccessfulDestination() { $validate = new Validate(); $root = vfsStream::setup('test')->url(); $existingFolder = $root . '/existingFolder'; mkdir($existingFolder); $this->assertEquals($existingFolder, $validate->destination($existingFolder)); }
/** * Check & validate the destination parameter * @param Validate $validate Validate instance * @param Task $task Download task * @param string $option Option value */ public function destinationParameter(Validate $validate, Task $task, $option) { $destination = $validate->destination($option); $task->setDestination($destination); $this->verboseOutput('Download photos to ' . $destination . '.' . PHP_EOL); }