Testing

Testing

ElmapiCMS ships with an automated test suite built with Pest on top of PHPUnit. Use it to verify your local install after upgrades, or when you customize the application.

This page is a short introduction for self-hosters who have the full application source (including Composer require-dev packages). You do not need to run these tests to operate ElmapiCMS in production.


Requirements

  • A local install from the full Laravel project (see Installation)
  • PHP 8.4+ and Composer dependencies installed with development packages:
composer install

If you previously installed with --no-dev, re-run composer install without that flag so Pest and related tools are available.

Tests use their own environment from phpunit.xml (SQLite in-memory database, array cache/session/mail). They do not use or modify your .env database.


What’s in the suite

LocationPurpose
tests/Feature/HTTP, API, dashboard, auth, projects, content, assets, webhooks, and related flows
tests/Unit/Focused model and unit checks
tests/Pest.phpPest bootstrap for Feature tests

Feature coverage includes the Content API, Authentication, asset library, permissions, settings, and more.


Running tests

From the project root:

# Full suite
php artisan test
 
# Same as above (also clears config cache first)
composer test

Filter to a file or name

# One file
php artisan test tests/Feature/API/ApiRateLimitTest.php
 
# Match tests by name
php artisan test --filter="rate limit"

Compact output (optional):

php artisan test --compact

Tips

  • Run the suite on a clean local copy after upgrading, before deploying custom changes.
  • If tests fail unexpectedly, clear caches (php artisan optimize:clear) and ensure composer install completed without --no-dev.
  • Frontend template builds hitting API 429 errors are unrelated to this suite — see Troubleshooting.

If you find a failing test that looks like a product bug, see Getting Help & Support.

Search documentation

Find guides and reference pages