aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/Wallabag/CoreBundle/Command
diff options
context:
space:
mode:
authorNicolas Hart <contact@nclshart.net>2017-07-31 23:20:41 +0200
committerNicolas Hart <contact@nclshart.net>2017-07-31 23:20:41 +0200
commitf7a4b441361404b378c30b7788b3699c208537ad (patch)
tree6e0b786d397dbafdc1e6845e6ce59344f8d65f76 /tests/Wallabag/CoreBundle/Command
parentaf31cfed769538fcb7d283cb1fad80ac8d07b663 (diff)
downloadwallabag-f7a4b441361404b378c30b7788b3699c208537ad.tar.gz
wallabag-f7a4b441361404b378c30b7788b3699c208537ad.tar.zst
wallabag-f7a4b441361404b378c30b7788b3699c208537ad.zip
add search argument and limit option to list users command
Diffstat (limited to 'tests/Wallabag/CoreBundle/Command')
-rw-r--r--tests/Wallabag/CoreBundle/Command/ListUserCommandTest.php51
1 files changed, 50 insertions, 1 deletions
diff --git a/tests/Wallabag/CoreBundle/Command/ListUserCommandTest.php b/tests/Wallabag/CoreBundle/Command/ListUserCommandTest.php
index 5e644247..9068cf59 100644
--- a/tests/Wallabag/CoreBundle/Command/ListUserCommandTest.php
+++ b/tests/Wallabag/CoreBundle/Command/ListUserCommandTest.php
@@ -21,6 +21,55 @@ class ListUserCommandTest extends WallabagCoreTestCase
21 'command' => $command->getName(), 21 'command' => $command->getName(),
22 ]); 22 ]);
23 23
24 $this->assertContains('3 user(s) displayed.', $tester->getDisplay()); 24 $this->assertContains('3/3 user(s) displayed.', $tester->getDisplay());
25 }
26
27 public function testRunListUserCommandWithLimit()
28 {
29 $application = new Application($this->getClient()->getKernel());
30 $application->add(new ListUserCommand());
31
32 $command = $application->find('wallabag:user:list');
33
34 $tester = new CommandTester($command);
35 $tester->execute([
36 'command' => $command->getName(),
37 '--limit' => 2,
38 ]);
39
40 $this->assertContains('2/3 user(s) displayed.', $tester->getDisplay());
41 }
42
43 public function testRunListUserCommandWithSearch()
44 {
45 $application = new Application($this->getClient()->getKernel());
46 $application->add(new ListUserCommand());
47
48 $command = $application->find('wallabag:user:list');
49
50 $tester = new CommandTester($command);
51 $tester->execute([
52 'command' => $command->getName(),
53 'search' => 'boss',
54 ]);
55
56 $this->assertContains('1/3 (filtered) user(s) displayed.', $tester->getDisplay());
57 }
58
59 public function testRunListUserCommandWithSearchAndLimit()
60 {
61 $application = new Application($this->getClient()->getKernel());
62 $application->add(new ListUserCommand());
63
64 $command = $application->find('wallabag:user:list');
65
66 $tester = new CommandTester($command);
67 $tester->execute([
68 'command' => $command->getName(),
69 'search' => 'bo',
70 '--limit' => 1,
71 ]);
72
73 $this->assertContains('1/3 (filtered) user(s) displayed.', $tester->getDisplay());
25 } 74 }
26} 75}