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
| Test | Covers |
|---|---|
test-text-tag-collector.php | text-tag collector |
test-link-classifier.php | link classifier (incl. target extraction) |
test-uid-tag-collector.php | UID tag collector |
test-uid-index-service.php | UID index service |
test-i18n-mark.php | i18n markers |
test-wthb-toc-service.php | WTHB 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>]