PHPUnit Support
GitAuto runs PHPUnit for PHP projects as part of the quality verification pipeline. When a repository is configured for PHP, generated test files are executed with PHPUnit instead of Jest or Vitest, ensuring the tests are validated using the correct language-specific test runner before being committed.
PHP Projects Need the Right Test Runner
PHP projects need PHPUnit, not Jest. Without language-specific test runner support, PHP test generation would produce unverified code - test files that have never actually been executed. The agent would commit PHP tests without knowing whether they pass, leaving all verification to the human reviewer and CI.
PHPUnit support ensures PHP projects get the same quality verification that JavaScript and TypeScript projects get with Jest/Vitest: tests are run, coverage is collected, and failures are caught before the PR is created.
Why Language-Specific Runners Matter
Models can generate PHP test code, but they can't execute it. A test that looks correct to the model might fail due to PHP-specific issues: autoloading paths, namespace resolution, or PHPUnit version differences. The only way to know if a PHP test actually works is to run it with PHPUnit - something models cannot do on their own.
How It Works
GitAuto detects PHP projects by checking for composer.json and phpunit.xml (or phpunit.xml.dist) configuration files. Per-repository configuration determines which test runner to use. When PHPUnit is selected, GitAuto runs the generated test file with PHPUnit, collects the output, and processes pass/fail results the same way it handles Jest/Vitest results.
Coverage collection works through PHPUnit's built-in coverage reporting, which feeds into the same coverage enforcement pipeline used by other test runners.
Related Features
- Test Execution - runs tests before committing to verify they pass
- Coverage Enforcement - enforces coverage targets using data from PHPUnit runs
Need Help?
Have questions or suggestions? We're here to help you get the most out of GitAuto.
Contact us with your questions or feedback!