/** * Check & validate the featured parameter * @param Task $task Download task * @param bool $option Option value */ public function featuredParameter(Task $task, $option) { $task->setFeatured($option); if ($option === true) { $this->verboseOutput('Download only featured photos.'); } $this->verboseOutput('Download featured and not featured photos.'); }
/** * Test Simondubois\UnsplashDownloader\Task::getFeatured() * & Simondubois\UnsplashDownloader\Task::setFeatured() */ public function testFeatured() { // Instantiate task & custom value $task = new Task(); $featured = true; // Assert default value $this->assertNull($task->getFeatured()); // Assert custom value $task->setFeatured($featured); $this->assertEquals($featured, $task->getFeatured()); }