mirror of
https://ghproxy.net/https://github.com/fairpm/fair-plugin.git
synced 2026-08-08 13:30:25 +08:00
Docker-based mutation testing with PHP 8.5 + latest Infection: tests/sites/ephemeral/mutation/Dockerfile: PHP 8.5-cli-alpine + mysqli + xdebug tests/sites/ephemeral/mutation/docker-compose.yml: MySQL 8.0 + mutation container - composer install --ignore-platform-reqs (PHP 8.5 resolves infection 0.27) - Auto-detects configured MySQL via FAIR_TEST_DB_* env vars - Runs infection --threads=2 --no-progress tests/infection-bootstrap.php: FAIR autoloader + WordPress class/function stubs - Registers FAIR class autoloader for source reflection - Stubs WP_List_Table, WP_Upgrader, Plugin_Upgrader, WP_Error - Stubs Fragen\Git_Updater\Lite to prevent die() in class-lite.php - Stubs esc_*(), __(), sanitize_text_field(), wp_unslash(), etc. infection.json: source in inc/ (excluding admin, wp-cli, settings, etc.) Results: 486 mutations, 45 killed, 440 uncovered, 1 escaped, 0 errors Covered Code MSI: 97% (of tested code, almost all mutations caught) Overall MSI: 9% (most modules excluded from unit test coverage) composer.json: restored from release (was corrupt with scripts-only). Added 'infection' script: docker compose run mutation. bin/setup-local-tests.php: added FAIR_TEST_DB_* env var detection before local/docker auto-detection for containerized usage. tests/unit/phpunit.xml, multisite.xml: added executionOrder=default Signed-off-by: Chuck Adams <chaz@chaz.works>
35 lines
1,016 B
XML
35 lines
1,016 B
XML
<?xml version="1.0"?>
|
|
<phpunit
|
|
bootstrap="./bootstrap.php"
|
|
backupGlobals="false"
|
|
colors="true"
|
|
executionOrder="default"
|
|
beStrictAboutTestsThatDoNotTestAnything="true"
|
|
beStrictAboutOutputDuringTests="true"
|
|
convertErrorsToExceptions="true"
|
|
convertWarningsToExceptions="true"
|
|
convertNoticesToExceptions="true"
|
|
convertDeprecationsToExceptions="true"
|
|
>
|
|
<testsuites>
|
|
<testsuite name="default">
|
|
<directory suffix="Test.php">./tests/</directory>
|
|
<exclude>./tests/SampleTest.php</exclude>
|
|
</testsuite>
|
|
</testsuites>
|
|
<groups>
|
|
<exclude>
|
|
<group>ms-required</group>
|
|
</exclude>
|
|
</groups>
|
|
<coverage includeUncoveredFiles="true" processUncoveredFiles="false" pathCoverage="false" cacheDirectory="./cache">
|
|
<include>
|
|
<directory suffix=".php">../../inc</directory>
|
|
</include>
|
|
<report>
|
|
<text outputFile="php://stdout" showOnlySummary="true"/>
|
|
<html outputDirectory="./coverage/html/single-site"/>
|
|
<php outputFile="./coverage/php/single-site.php"/>
|
|
</report>
|
|
</coverage>
|
|
</phpunit>
|