Skip to content

Conversation

@tosfos
Copy link
Contributor

@tosfos tosfos commented Dec 24, 2025

This PR fixes a PHPUnit test failure in the CI pipeline by adding the php8.1-bcmath extension to the Dockerfile.

Problem

The MediaWiki 1.43 ScrambleMapping class requires either the bcmath or gmp PHP extension. The current Dockerfile was missing both extensions, causing this PHPUnit test error:

MediaWiki\Tests\User\TempUser\ScrambleMappingTest::testOffsetTooLarge
RuntimeException: MediaWiki\User\TempUser\ScrambleMapping requires the bcmath or gmp extension

Solution

Added php8.1-bcmath to the list of PHP extensions installed in the Docker image. The bcmath extension provides arbitrary-precision mathematics functions needed by the ScrambleMapping class.

Testing

This change will be tested by the existing CI pipeline which runs PHPUnit tests against MediaWiki core.

@tosfos tosfos marked this pull request as draft December 24, 2025 20:21
MediaWiki 1.43's ScrambleMapping class requires either bcmath or gmp PHP extension.
This fixes the PHPUnit test error: 'ScrambleMapping requires the bcmath or gmp extension'
@tosfos tosfos force-pushed the fix-scramble-mapping-extension branch from 57103fe to 1d755cb Compare December 24, 2025 20:27
@tosfos
Copy link
Contributor Author

tosfos commented Dec 24, 2025

The issue was found while integrating PHPUnit tests in #46 . Before this change, I got:

MediaWiki\Tests\User\TempUser\ScrambleMappingTest::testOffsetTooLarge
RuntimeException: MediaWiki\User\TempUser\ScrambleMapping requires the bcmath or gmp extension
/var/www/mediawiki/w/includes/user/TempUser/ScrambleMapping.php:74
/var/www/mediawiki/w/tests/phpunit/unit/includes/user/TempUser/ScrambleMappingTest.php:37

After this change, this test was no longer failing.

@tosfos tosfos marked this pull request as ready for review December 24, 2025 20:31
@github-actions
Copy link

🐳 The image based on 57103fe7 commit has been built with 1.43.6-20251224-47 tag as ghcr.io/canastawiki/canasta-base:1.43.6-20251224-47

@yaronkoren yaronkoren merged commit c9849fc into master Dec 25, 2025
@tosfos tosfos deleted the fix-scramble-mapping-extension branch December 26, 2025 00:20
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.

3 participants