Skip to content

Commit 78de59b

Browse files
committed
minor #57792 Replace TestCase::assertTrue(true) with TestCase::expectNotToPerformAssertions() (alexandre-daubois)
This PR was merged into the 7.2 branch. Discussion ---------- Replace `TestCase::assertTrue(true)` with `TestCase::expectNotToPerformAssertions()` | Q | A | ------------- | --- | Branch? | 7.2 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | - | License | MIT Commits ------- ee8509e Replace `TestCase::assertTrue(true)` with `TestCase::expectNotToPerformAssertions()`
2 parents a03a2f6 + ee8509e commit 78de59b

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

src/Symfony/Component/Console/Tests/Command/CompleteCommandTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ public function testUnsupportedShellOption()
5353

5454
public function testAdditionalShellSupport()
5555
{
56+
$this->expectNotToPerformAssertions();
57+
5658
$this->command = new CompleteCommand(['supported' => BashCompletionOutput::class]);
5759
$this->command->setApplication($this->application);
5860
$this->tester = new CommandTester($this->command);
@@ -61,8 +63,6 @@ public function testAdditionalShellSupport()
6163

6264
// verify that the default set of shells is still supported
6365
$this->execute(['--shell' => 'bash', '--current' => '1', '--input' => ['bin/console']]);
64-
65-
$this->assertTrue(true);
6666
}
6767

6868
/**

src/Symfony/Component/Finder/Tests/Iterator/RecursiveDirectoryIteratorTest.php

+2-3
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,10 @@ protected function setUp(): void
2727
*/
2828
public function testRewindOnFtp()
2929
{
30-
$i = new RecursiveDirectoryIterator('ftp://speedtest:speedtest@ftp.otenet.gr/', \RecursiveDirectoryIterator::SKIP_DOTS);
30+
$this->expectNotToPerformAssertions();
3131

32+
$i = new RecursiveDirectoryIterator('ftp://speedtest:speedtest@ftp.otenet.gr/', \RecursiveDirectoryIterator::SKIP_DOTS);
3233
$i->rewind();
33-
34-
$this->assertTrue(true);
3534
}
3635

3736
/**

src/Symfony/Component/Mailer/Tests/MailerTest.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ public function dispatch($message, array $stamps = []): Envelope
8686

8787
public function testRejectMessage()
8888
{
89+
$this->expectNotToPerformAssertions();
90+
8991
$dispatcher = new EventDispatcher();
9092
$dispatcher->addListener(MessageEvent::class, fn (MessageEvent $event) => $event->reject(), 255);
9193
$dispatcher->addListener(MessageEvent::class, fn () => throw new \RuntimeException('Should never be called.'));
@@ -111,6 +113,5 @@ public function __toString(): string
111113
$message = new RawMessage('');
112114
$envelope = new MailerEnvelope(new Address('fabien@example.com'), [new Address('helene@example.com')]);
113115
$mailer->send($message, $envelope);
114-
$this->assertTrue(true);
115116
}
116117
}

src/Symfony/Component/Validator/Tests/Constraints/NotCompromisedPasswordValidatorTest.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,9 @@ public function testApiError()
213213
*/
214214
public function testApiErrorSkipped(NotCompromisedPassword $constraint)
215215
{
216+
$this->expectNotToPerformAssertions();
217+
216218
$this->validator->validate(self::PASSWORD_TRIGGERING_AN_ERROR, $constraint);
217-
$this->assertTrue(true); // No exception have been thrown
218219
}
219220

220221
public static function provideErrorSkippingConstraints(): iterable

0 commit comments

Comments
 (0)