/** * Tests the create file task. * * @return void */ public function testCreateFiles() { // Create empty directories $this->createTestDirectories(array('/webapps/cruisecontrol/js', '/webapps/cruisecontrol/xsl')); $files = array('/webapps/cruisecontrol/js/scriptaculous.js', '/webapps/cruisecontrol/xsl/phpcs.xsl'); foreach ($files as $file) { $this->assertFileNotExists(PHPUC_TEST_DIR . $file); } $args = $this->prepareConsoleArgs(array('example', PHPUC_TEST_DIR)); $task = new phpucCreateFileTask(); $task->setFiles($files); $task->setConsoleArgs($args); $task->execute(); foreach ($files as $file) { $this->assertFileExists(PHPUC_TEST_DIR . $file); } }
/** * Creates all command specific {@link phpucTaskI} objects. * * @return array(phpucTaskI) */ protected function doCreateTasks() { $tasks = array(); $modifyFileTask = new phpucModifyFileTask(); $modifyFileTask->setFiles($this->modifiedFiles); $createFileTask = new phpucCreateFileTask(); $createFileTask->setFiles($this->installFiles); $tasks[] = new phpucCruiseControlTask(); $tasks[] = $modifyFileTask; $tasks[] = $createFileTask; return $tasks; }