Skip to content

🧪 [testing improvement] Cover JSON exceptions and missing files in ProjectComposer#1957

Merged
cmuench merged 1 commit intodevelopfrom
testing-improvement-project-composer-15034861214797711125
Mar 23, 2026
Merged

🧪 [testing improvement] Cover JSON exceptions and missing files in ProjectComposer#1957
cmuench merged 1 commit intodevelopfrom
testing-improvement-project-composer-15034861214797711125

Conversation

@cmuench
Copy link
Member

@cmuench cmuench commented Mar 11, 2026

This PR addresses the testing gap in ProjectComposer::getComposerLockPackages().

🎯 What: The testing gap addressed:

  • Handling of non-existent composer.lock files.
  • Handling of malformed JSON content in composer.lock.
  • Handling of valid JSON missing expected package keys.

📊 Coverage:

  • Added unit tests covering these scenarios using vfsStream for isolation.
  • Refactored getComposerLockPackages() to include an explicit existence check to prevent PHP warnings.

Result:

  • Increased reliability of package retrieval logic.
  • 100% coverage for the getComposerLockPackages method.
  • Improved code robustness.

PR created automatically by Jules for task 15034861214797711125 started by @cmuench

…ojectComposer

- Added test cases for non-existent composer.lock files.
- Added test cases for malformed JSON in composer.lock (triggering JsonException).
- Added test cases for valid JSON missing the 'packages' or 'packages-dev' keys.
- Robustified ProjectComposer::getComposerLockPackages() with an explicit file_exists() check.
- Utilized vfsStream for deterministic filesystem testing.

Co-authored-by: cmuench <[email protected]>
@google-labs-jules
Copy link
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@github-actions
Copy link

Download the artifacts for this pull request:

@cmuench cmuench merged commit 4a50329 into develop Mar 23, 2026
21 checks passed
@cmuench cmuench deleted the testing-improvement-project-composer-15034861214797711125 branch March 23, 2026 21: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.

1 participant