Skip to content

Add contextValueEquals() matcher to TestLogger#17

Closed
MidnightDesign wants to merge 1 commit intomasterfrom
worktree-logger-context-value
Closed

Add contextValueEquals() matcher to TestLogger#17
MidnightDesign wants to merge 1 commit intomasterfrom
worktree-logger-context-value

Conversation

@MidnightDesign
Copy link
Copy Markdown
Contributor

Summary

  • Adds TestLogger::contextValueEquals(string $key, mixed $expected) as a convenience shorthand for contextValueMatches($key, Val::eq($expected))
  • Fixes a malformed use statement (two imports merged onto one line)
  • Adds PHPUnit test cases covering the match and failure paths
  • Documents the new method in doc/TestLogger.md

Test plan

  • vendor/bin/phpunit tests/unit/TestLoggerTest.php passes (32 tests, 49 assertions)

Provides a concise way to assert that a log context key holds a
specific value using strict equality, without writing a custom
value-matcher callable.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@MidnightDesign
Copy link
Copy Markdown
Contributor Author

That's saving a few characters - if that. Not worth it.

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