From 23634d5d842dabcf5d7475e2becb7e127824239e Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Wed, 1 Jun 2016 21:27:35 +0200 Subject: Jump to Symfony 3.1 --- .../CoreBundle/Command/TagAllCommandTest.php | 60 ++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 tests/Wallabag/CoreBundle/Command/TagAllCommandTest.php (limited to 'tests/Wallabag/CoreBundle/Command/TagAllCommandTest.php') diff --git a/tests/Wallabag/CoreBundle/Command/TagAllCommandTest.php b/tests/Wallabag/CoreBundle/Command/TagAllCommandTest.php new file mode 100644 index 00000000..ec31708f --- /dev/null +++ b/tests/Wallabag/CoreBundle/Command/TagAllCommandTest.php @@ -0,0 +1,60 @@ +getClient()->getKernel()); + $application->add(new TagAllCommand()); + + $command = $application->find('wallabag:tag:all'); + + $tester = new CommandTester($command); + $tester->execute([ + 'command' => $command->getName(), + ]); + } + + public function testRunTagAllCommandWithBadUsername() + { + $application = new Application($this->getClient()->getKernel()); + $application->add(new TagAllCommand()); + + $command = $application->find('wallabag:tag:all'); + + $tester = new CommandTester($command); + $tester->execute([ + 'command' => $command->getName(), + 'username' => 'unknown', + ]); + + $this->assertContains('User "unknown" not found', $tester->getDisplay()); + } + + public function testRunTagAllCommand() + { + $application = new Application($this->getClient()->getKernel()); + $application->add(new TagAllCommand()); + + $command = $application->find('wallabag:tag:all'); + + $tester = new CommandTester($command); + $tester->execute([ + 'command' => $command->getName(), + 'username' => 'admin', + ]); + + $this->assertContains('Tagging entries for user « admin »... Done', $tester->getDisplay()); + } +} -- cgit v1.2.3