'User from which to export entries'
)
->addArgument(
- 'filename',
+ 'filepath',
InputArgument::OPTIONAL,
'Path of the exported file'
)
$output->write(sprintf('Exporting %d entrie(s) for user « <comment>%s</comment> »... ', count($entries), $user->getUserName()));
- $filePath = $input->getArgument('filename');
+ $filePath = $input->getArgument('filepath');
if (!$filePath) {
$filePath = $this->getContainer()->getParameter('kernel.root_dir') . '/../' . sprintf('%s-export', $user->getUsername());
}
$this->assertContains('Exporting 6 entrie(s) for user « admin »... Done', $tester->getDisplay());
}
+
+ public function testExportCommandWithSpecialPath()
+ {
+ $application = new Application($this->getClient()->getKernel());
+ $application->add(new ExportCommand());
+
+ $command = $application->find('wallabag:export');
+
+ $tester = new CommandTester($command);
+ $tester->execute([
+ 'command' => $command->getName(),
+ 'username' => 'admin',
+ 'filepath' => 'specialexport.json'
+ ]);
+
+ $this->assertFileExists('specialexport.json');
+ }
}