Make three tests pass outside MySQL and on PHP 8.1
Problem/Motivation
Running the suite on Drupal 10.4 and 10.6 with PHP 8.1 and SQLite showed three tests that fail for reasons outside the module:
AiDisclosureAuditSuggestionNoteUpdateTestreadsINFORMATION_SCHEMA.COLUMNSwithDATABASE(), which only exists on MySQL and MariaDB.AiDisclosureImageXmpGdTest::testAvifIsMarkedWithExiftoolexpectsgetimagesize()to read the AVIF size, and PHP 8.1 returns 0x0 even for the unmarked file.AiDisclosureImageXmpImagemagickTest::testOtherDerivativesAreUntouchedcompares md5 hashes, and ImageMagick writesdate:createanddate:modifyPNG chunks to the second, so two derivatives made across a second boundary differ.
Proposed resolution
- Skip the INFORMATION_SCHEMA test when the database is not MySQL.
- Compare the AVIF size with the size of the original instead of a fixed value.
- Compare the derivatives without the date chunks, or by pixels.
Remaining tasks
- The three changes
- Green run on SQLite with PHP 8.1, Drupal 10.4 and 10.6
AI Compliance
🤖 Generated with the help of an LLM, reviewed and approved by me before posting.
Edited by Giorgio Alfredo Pagano