Skip to content

Replace TestCase::assertTrue(true) with TestCase::expectNotToPerformAssertions() #57792

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ public function testUnsupportedShellOption()

public function testAdditionalShellSupport()
{
$this->expectNotToPerformAssertions();

$this->command = new CompleteCommand(['supported' => BashCompletionOutput::class]);
$this->command->setApplication($this->application);
$this->tester = new CommandTester($this->command);
Expand All @@ -61,8 +63,6 @@ public function testAdditionalShellSupport()

// verify that the default set of shells is still supported
$this->execute(['--shell' => 'bash', '--current' => '1', '--input' => ['bin/console']]);

$this->assertTrue(true);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,10 @@ protected function setUp(): void
*/
public function testRewindOnFtp()
{
$i = new RecursiveDirectoryIterator('ftp://speedtest:speedtest@ftp.otenet.gr/', \RecursiveDirectoryIterator::SKIP_DOTS);
$this->expectNotToPerformAssertions();

$i = new RecursiveDirectoryIterator('ftp://speedtest:speedtest@ftp.otenet.gr/', \RecursiveDirectoryIterator::SKIP_DOTS);
$i->rewind();

$this->assertTrue(true);
}

/**
Expand Down
3 changes: 2 additions & 1 deletion src/Symfony/Component/Mailer/Tests/MailerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ public function dispatch($message, array $stamps = []): Envelope

public function testRejectMessage()
{
$this->expectNotToPerformAssertions();

$dispatcher = new EventDispatcher();
$dispatcher->addListener(MessageEvent::class, fn (MessageEvent $event) => $event->reject(), 255);
$dispatcher->addListener(MessageEvent::class, fn () => throw new \RuntimeException('Should never be called.'));
Expand All @@ -111,6 +113,5 @@ public function __toString(): string
$message = new RawMessage('');
$envelope = new MailerEnvelope(new Address('fabien@example.com'), [new Address('helene@example.com')]);
$mailer->send($message, $envelope);
$this->assertTrue(true);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,9 @@ public function testApiError()
*/
public function testApiErrorSkipped(NotCompromisedPassword $constraint)
{
$this->expectNotToPerformAssertions();

$this->validator->validate(self::PASSWORD_TRIGGERING_AN_ERROR, $constraint);
$this->assertTrue(true); // No exception have been thrown
}

public static function provideErrorSkippingConstraints(): iterable
Expand Down
Loading