refactor: emit integration diagnostics via STDERR#13
Merged
Conversation
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors integration-test diagnostics by replacing raw error_log() calls with fwrite( STDERR, ... ), aligning the test suite with the codebase’s logging cleanup while preserving always-on diagnostic output during PHPUnit runs.
Changes:
- Replace two
error_log()diagnostics withfwrite( STDERR, ... )in the integration test suite. - Add/adjust diagnostic comment text and ensure diagnostics include trailing newlines.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replaces the two raw
error_log()calls intests/integration/DatabaseIntegrationTest.phpwithfwrite( STDERR, ... ).Background
Closes out the long-running
error_log()->Loggercleanup. Productionincludes/already routes throughWPVDB\Logger(the only sanctioned rawerror_log()is the centralized, phpcs-ignored sink atclass-wpvdb-logger.php:174). The last raw calls were these two integration-test diagnostics.fwrite( STDERR, ... )is the right fit here rather thanLogger:Logger::debug()is gated behindwpvdb_should_log_to_error_log()and would silence them.fwrite( STDERR, ... )is the PHPUnit-idiomatic way to emit a diagnostic and avoids theWordPress.PHP.DevelopmentFunctions.error_log_error_logsmell.After this, no raw
error_log()calls remain anywhere except the sanctioned sink.Testing
php -lclean. Behavior preserved (diagnostics still print, now to STDERR). Note: this test file is integration-only (self-skips without a real DB) and is outside the phpcs scan surface, so this is a focused 3-line change.🤖 Generated with Claude Code