Repository navigation
Fix topic_likes_test in CI (missing global $auth) - #211
Merged
Merged
Conversation
CI's bootstrap loads phpBB's real censor_text(), which reads global $auth; the global stub in the test file never applies there. The test set $config and $user but not $auth, so both cases errored with "Call to a member function acl_get() on null" on every CI job since #208. Set a mocked $auth as recenttopics_events_test already does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
CI has been red on
develop33since #208. Both cases intests/core/topic_likes_test.phperror withCall to a member function acl_get() on nullinincludes/functions_content.php:1595, on every PHP/DB job and on Windows.Cause: CI's phpBB test bootstrap loads the real
censor_text(), which reads the global$auth, so thecensor_text()stub in the test file never applies there. The test set$GLOBALS['config']and$GLOBALS['user']but not$GLOBALS['auth']. It passed locally only because my local harness didn't loadfunctions_content.php.Fix: set a mocked
$GLOBALS['auth'](acl_get()→ true), exactly asrecenttopics_events_testalready does. Test-only change.Verified: I changed the local harness to load
functions_content.phplike CI. That reproduced the 2 errors; with this change the suite passes (69 tests, 0 failures). I'll confirm the CI run on this PR before calling it done.🤖 Generated with Claude Code