Skip to content

PHPLIB-1135: Remove var_dump from tests, use print_r instead #1081

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 2 commits into from
May 26, 2023

Conversation

GromNaN
Copy link
Member

@GromNaN GromNaN commented May 26, 2023

var_dump output is modified by xdebug, what causes tests to fail during debug.

I think it's easier to read this way.

There other calls to var_dump in DocumentationExamplesTest, but they are hidden and not tested.

var_dump output is modified by xdebug, leading to test failure during debug
@GromNaN GromNaN requested review from jmikola and alcaeus May 26, 2023 00:01
@GromNaN GromNaN self-assigned this May 26, 2023
Copy link
Member

@jmikola jmikola left a comment

Choose a reason for hiding this comment

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

LGTM with removed psalm-suppress annotations.

@@ -106,4 +106,4 @@ public function bsonUnserialize(array $data): void
$foundEntry = $collection->findOne([]);

/** @psalm-suppress ForbiddenCode */
Copy link
Member

Choose a reason for hiding this comment

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

ForbiddenCode suppressions can be removed as only var_dump and shell_exec are included by default: https://psalm.dev/docs/running_psalm/configuration/#forbiddenfunctions

I tested this locally and confirmed.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done. This further impacts my lines added < lines deleted ratio. 😂

Copy link
Member

@alcaeus alcaeus left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@GromNaN GromNaN merged commit 3bd3fb4 into mongodb:master May 26, 2023
@GromNaN GromNaN deleted the PHPLIB-1135 branch May 26, 2023 07:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants