Testing
Test-Kette: PHP-Standalone, PHPStan und JS (Mocha)
Die komplette Kette läuft mit:
npm test
Das führt test:php → analyse:php → test:js aus, wobei jeder Schritt bestehen muss, bevor der nächste läuft.
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
# führt jedes tests/test-*.php mit dem System-PHP aus — ohne webtrees, ohne DB
| Test | Abgedeckt |
|---|---|
test-text-tag-collector.php | Text-Tag-Collector |
test-link-classifier.php | Link-Klassifizierer (inkl. Ziel-Extraktion) |
test-uid-tag-collector.php | UID-Tag-Collector |
test-uid-index-service.php | UID-Index-Service |
test-i18n-mark.php | i18n-Marker |
test-wthb-toc-service.php | WTHB-TOC-Service |
PHP-Statische Analyse
npm run analyse:php # oder: composer analyse
# PHPStan Level 6 — siehe die PHPStan-Seite
Smoke-Tests (brauchen webtrees + DB)
Diese üben eine echte Installation und sind nicht Teil von npm test:
php tests/smoke-text-tag-collector.php [limit]
php tests/smoke-migration5.php
php tests/p1-measure.php [--tree=<id>]