/** * @test */ public function testPhotoSortCopy() { $this->copyFixturesIntoDir($this->fooDir); $photoSort = new PhotoSort(); $photoSort->copy($this->fooDir, $this->varDir); $this->assertFileExists($this->varDir . '/2015-03-14 12:57:43.jpg'); }
/** * Execute command * * @param InputInterface $input * @param OutputInterface $output * * @return bool */ protected function execute(InputInterface $input, OutputInterface $output) { $quiet = $output->getVerbosity() == OutputInterface::VERBOSITY_QUIET; $verbose = $output->getVerbosity() == OutputInterface::VERBOSITY_VERBOSE; if (!$quiet) { $output->write('<info>' . $this->getApplication()->getName() . '</info>'); $output->write(' version <comment>' . $this->getApplication()->getVersion() . '</comment> '); $output->writeln("by J.Ginés Hernández G. <*****@*****.**>\n"); } $sourcePath = $input->getArgument('source'); $destPath = $input->getArgument('dest'); $formatType = $input->getOption('format'); $sortImg = new PhotoSort($verbose); $items = $sortImg->copy($sourcePath, $destPath, $formatType); if ($verbose) { if (count($items)) { $table = new Table($output); $table->setHeaders(array('Old File', 'New File')); $table->setRows($items); $table->render(); } $output->writeln("\nCheers!\n"); } return true; }