3 namespace Tests\Wallabag\CoreBundle\Command
;
5 use Symfony\Bundle\FrameworkBundle\Console\Application
;
6 use Symfony\Component\Console\Tester\CommandTester
;
7 use Tests\Wallabag\CoreBundle\WallabagCoreTestCase
;
8 use Wallabag\CoreBundle\Command\ListUserCommand
;
10 class ListUserCommandTest
extends WallabagCoreTestCase
12 public function testRunListUserCommand()
14 $application = new Application($this->getClient()->getKernel());
15 $application->add(new ListUserCommand());
17 $command = $application->find('wallabag:user:list');
19 $tester = new CommandTester($command);
21 'command' => $command->getName(),
24 $this->assertContains('3/3 user(s) displayed.', $tester->getDisplay());
27 public function testRunListUserCommandWithLimit()
29 $application = new Application($this->getClient()->getKernel());
30 $application->add(new ListUserCommand());
32 $command = $application->find('wallabag:user:list');
34 $tester = new CommandTester($command);
36 'command' => $command->getName(),
40 $this->assertContains('2/3 user(s) displayed.', $tester->getDisplay());
43 public function testRunListUserCommandWithSearch()
45 $application = new Application($this->getClient()->getKernel());
46 $application->add(new ListUserCommand());
48 $command = $application->find('wallabag:user:list');
50 $tester = new CommandTester($command);
52 'command' => $command->getName(),
56 $this->assertContains('1/3 (filtered) user(s) displayed.', $tester->getDisplay());
59 public function testRunListUserCommandWithSearchAndLimit()
61 $application = new Application($this->getClient()->getKernel());
62 $application->add(new ListUserCommand());
64 $command = $application->find('wallabag:user:list');
66 $tester = new CommandTester($command);
68 'command' => $command->getName(),
73 $this->assertContains('1/3 (filtered) user(s) displayed.', $tester->getDisplay());