Skip to content
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

Use assertCount() when possible #5535

Merged
merged 1 commit into from Jul 25, 2022

Conversation

derrabus
Copy link
Member

Q A
Type improvement
Fixed issues N/A

Summary

A small improvement for the test suite. We should use assertCount() instead of assertEquals($someNumber, count(…)). In case of a failure, we will get a nicer error message this way.

@@ -513,7 +513,7 @@ public function testCreateTableWithForeignKeys(): void

$fkTable = $this->schemaManager->listTableDetails('test_create_fk');
$fkConstraints = $fkTable->getForeignKeys();
self::assertEquals(1, count($fkConstraints), "Table 'test_create_fk1' has to have one foreign key.");
self::assertCount(1, $fkConstraints, "Table 'test_create_fk' has to have one foreign key.");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@morozov morozov merged commit de42378 into doctrine:3.3.x Jul 25, 2022
@derrabus derrabus deleted the improvement/assert-count branch July 25, 2022 20:29
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants