Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

refactor: consolidate repetitive model instantiations across tests #3416

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

Open
zigzagdev wants to merge 2 commits into mongodb:5.x
base: 5.x
Choose a base branch
Loading
from zigzagdev:feature/refactor-model-test

Conversation

Copy link

@zigzagdev zigzagdev commented Jun 24, 2025
edited
Loading

Description

This pull request refactors the test suite to eliminate redundant model instantiations. Several test cases repeatedly constructed identical User, Item, and Book model objects inline, leading to code duplication and reduced maintainability.

To address this:

  • A set of factory-like helper methods has been introduced to create consistent test data.
  • All repeated inline instantiations were replaced by these shared methods.
  • This improves readability, enforces consistency, and simplifies future updates.

This is a non-functional change (refactor only) and does not alter the behaviour or scope of any existing tests.

Checklist

  • Add tests and ensure they pass
スクリーンショット 2025年06月24日 10 38 00

@zigzagdev zigzagdev requested a review from a team as a code owner June 24, 2025 01:37
@zigzagdev zigzagdev changed the title (削除) **refactor: consolidate repetitive model instantiations across tests** (削除ここまで) (追記) refactor: consolidate repetitive model instantiations across tests (追記ここまで) Jun 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers

@GromNaN GromNaN GromNaN approved these changes

@paulinevos paulinevos Awaiting requested review from paulinevos paulinevos is a code owner automatically assigned from mongodb/dbx-php

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /