Skip to content

Commit fc39410

Browse files
Nek-voronkovich
andcommitted
Make ListUsersCommandTest more clear
Co-authored-by: Oleg Voronkovich <oleg-voronkovich@yandex.ru>
1 parent e8c4c86 commit fc39410

File tree

1 file changed

+7
-14
lines changed

1 file changed

+7
-14
lines changed

tests/Command/ListUsersCommandTest.php

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -36,25 +36,18 @@ public function maxResultsProvider(): ?\Generator
3636
yield [2];
3737
}
3838

39-
/**
40-
* @dataProvider sendEmailProvider
41-
*
42-
* This test ensure that the command actually sends an email when the parameter is specified
43-
*/
44-
public function testItSendsAnEmail(bool $sendAndEmail): void
39+
public function testItSendsNoEmailByDefault(): void
4540
{
46-
$this->executeCommand(
47-
// these are the arguments (only 1 is passed, the rest are missing)
48-
$sendAndEmail ? ['--send-to' => 'john.doe@symfony.com'] : []
49-
);
41+
$this->executeCommand([]);
5042

51-
$this->assertEmailCount($sendAndEmail ? 1 : 0);
43+
$this->assertEmailCount(0);
5244
}
5345

54-
public function sendEmailProvider(): ?\Generator
46+
public function testItSendsAnEmailIfOptionProvided(): void
5547
{
56-
yield [true];
57-
yield [false];
48+
$this->executeCommand(['--send-to' => 'john.doe@symfony.com']);
49+
50+
$this->assertEmailCount(1);
5851
}
5952

6053
protected function getCommandFqcn(): string

0 commit comments

Comments
 (0)