Skip to content

Fix topic_likes_test in CI (missing global $auth) - #211

Merged
avandenberghe merged 1 commit into
develop33from
fix-topic-likes-test-ci
Oct 4, 2026
Merged

avandenberghe merged 1 commit into
develop33from
fix-topic-likes-test-ci

Conversation

@avandenberghe

Copy link
Copy Markdown
Collaborator

CI has been red on develop33 since #208. Both cases in tests/core/topic_likes_test.php error with Call to a member function acl_get() on null in includes/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 the censor_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 load functions_content.php.

Fix: set a mocked $GLOBALS['auth'] (acl_get() → true), exactly as recenttopics_events_test already does. Test-only change.

Verified: I changed the local harness to load functions_content.php like 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

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>
@avandenberghe
avandenberghe merged commit 85632cb into develop33 Oct 4, 2026
28 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.

1 participant