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:

  • AiDisclosureAuditSuggestionNoteUpdateTest reads INFORMATION_SCHEMA.COLUMNS with DATABASE(), which only exists on MySQL and MariaDB.
  • AiDisclosureImageXmpGdTest::testAvifIsMarkedWithExiftool expects getimagesize() to read the AVIF size, and PHP 8.1 returns 0x0 even for the unmarked file.
  • AiDisclosureImageXmpImagemagickTest::testOtherDerivativesAreUntouched compares md5 hashes, and ImageMagick writes date:create and date:modify PNG 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