Testing

Test chain: PHP standalone, PHPStan, and JS (Mocha)

The full chain runs with:

npm test

which executes test:php → analyse:php → test:js, each step required to pass before the next runs.

JavaScript (Mocha + jsdom)

npm run test:js
# mocha 'resources/js/tests/**/*.test.js' --require jsdom-global/register

PHP standalone unit tests

npm run test:php
# runs every tests/test-*.php with the system PHP — no webtrees install, no DB
TestCovers
test-text-tag-collector.phptext-tag collector
test-link-classifier.phplink classifier (incl. target extraction)
test-uid-tag-collector.phpUID tag collector
test-uid-index-service.phpUID index service
test-i18n-mark.phpi18n markers
test-wthb-toc-service.phpWTHB TOC service

PHP static analysis

npm run analyse:php      # or: composer analyse
# PHPStan Level 6 — see the PHPStan page

Smoke tests (need webtrees + DB)

These exercise a real installation and are not part of npm test:

php tests/smoke-text-tag-collector.php [limit]
php tests/smoke-migration5.php
php tests/p1-measure.php [--tree=<id>]
Last modified November 2, 2026: applied repoFileURL, where applicable (21fa655)