Home Features Setup Guide Documentation FAQ GitHub

Testing & Quality

Understand which validation tools are included in SWAT and how to run them locally before pushing your changes.

Testing and quality overview

SWAT includes a small but practical set of validation tools for both backend and frontend code.

The goal is to catch issues early, keep the codebase consistent and make the CI pipeline more predictable. You can run the same checks locally before opening a pull request or pushing changes to a protected branch.

Included tools
🧪

PHPUnit

Used for backend unit and functional tests to validate your Symfony application behavior.

🔍

PHPStan

Used for static analysis to detect typing issues, invalid assumptions and unsafe PHP code paths.

ESLint

Used to enforce frontend code quality and catch common JavaScript or TypeScript mistakes.

Vitest

Used for frontend unit tests located in assets/scripts/tests/.

What is validated in CI
Area What is checked
Backend Symfony configuration, PHP dependencies, static analysis and PHPUnit test execution.
Frontend JavaScript and TypeScript linting, Vitest unit tests and frontend asset build.
Project consistency Dependency installation, command execution and overall workflow integrity before merge or deployment.
Run checks locally

Running these commands locally helps you catch issues earlier and reduces friction in pull requests.

# Run backend tests
php bin/phpunit

# Run PHP static analysis
vendor/bin/phpstan analyse

# Run frontend lint
npm run eslint

# Run frontend unit tests
npm run vitest

# Run frontend unit tests in watch mode
npm run vitest:watch

# Build frontend assets
npm run build

Why local validation matters

Faster feedback

You can catch issues immediately instead of discovering them only after pushing your code.

Cleaner pull requests

When the main checks already pass locally, CI becomes a confirmation step instead of a debugging environment.

Safer deployments

A more reliable validation routine makes the full pipeline safer from development to production.

Next steps

Continue with the CI/CD documentation to understand how these checks fit into the GitHub Actions workflows and how SWAT handles deployment after validation succeeds.