Skip to content

test: add test around file parsing handling - #129

Merged
deviantintegral merged 2 commits into
mainfrom
claude/fix-har-file-error-handling-bF5RC
Dec 15, 2025
Merged

deviantintegral merged 2 commits into
mainfrom
claude/fix-har-file-error-handling-bF5RC

Conversation

@deviantintegral

@deviantintegral deviantintegral commented Dec 15, 2025 •

Copy link
Copy Markdown
Owner

No description provided.

claude and others added 2 commits December 15, 2025 18:55
Changed the error handling in HarFileRepository::loadJson() to use
strict comparison (false === $contents) instead of truthiness check
(!$contents). This prevents incorrectly throwing an exception when
loading valid empty files.

The previous implementation would throw an exception for empty files
because an empty string is falsy in PHP, even though file_get_contents()
successfully read the file. The new implementation only throws when
file_get_contents() actually fails and returns false.

Added test coverage for the empty file case to ensure empty files
can be loaded without throwing exceptions.
@deviantintegral deviantintegral changed the title fix: empty HAR repository files pass load checks test: add test around file parsing handling Dec 15, 2025
@deviantintegral
deviantintegral merged commit 5fe68b7 into main Dec 15, 2025
11 checks passed
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.

2 participants