Upgrade test suite to Pest 5 - #34
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Upgrades the PHP test stack to Pest 5 + PHPUnit 13 and wires in first-party tooling (TIA, Agent, PHPStan, Rector) so tests, static analysis, and CI pipelines align with the new ecosystem.
Changes:
- Upgrade to Pest 5 / PHPUnit 13 and modernize existing Pest expectations across the suite.
- Enable Test Impact Analysis (TIA) with a dedicated baseline workflow and shared artifact usage.
- Add/enable quality tooling: Pest Agent plugin, PHPStan (including tests), and Rector (Pest coding style set) with CI checks.
Reviewed changes
Copilot reviewed 38 out of 39 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/TestCase.php | Adds pendingArtisan() helper for tests requiring PendingCommand. |
| tests/Pest.php | Keeps Feature/Browser on Tests\TestCase + RefreshDatabase; enables TIA config. |
| tests/Feature/Settings/ProfileUpdateTest.php | Updates expectations to Pest 5 chaining and toBeEmail(). |
| tests/Feature/SeasonModelTest.php | Adjusts expectation chaining (and(...)) for Pest 5 style. |
| tests/Feature/PublicProjectPagesTest.php | Refactors Inertia prop handling for the projects list. |
| tests/Feature/PublicGettingStartedPageTest.php | Uses new expectations (toHaveSameSize(), toBeFile()). |
| tests/Feature/PublicEventPagesTest.php | Refines Inertia assertions and adds stricter callback typing. |
| tests/Feature/ProjectCatalogueTest.php | Uses toContainOnlyInstancesOf() for catalogue assertions. |
| tests/Feature/PartnerCatalogueTest.php | Uses toContainOnlyInstancesOf() and toBeEmpty() expectations. |
| tests/Feature/MediaAssetModelTest.php | Converts chained property expectations to and(...) style. |
| tests/Feature/MakeAdminUserCommandTest.php | Switches to pendingArtisan() and adds toBeEmail() assertion. |
| tests/Feature/LocationModelTest.php | Uses and(...) + nullsafe access in relationship assertions. |
| tests/Feature/EventModelTest.php | Refactors relationship assertions into and(...) chain. |
| tests/Feature/DevelopmentEventSeederTest.php | Switches to pendingArtisan() and tightens snapshot/id helpers typing. |
| tests/Feature/ContactTest.php | Adds toBeEmail() assertion to contact submission checks. |
| tests/Feature/ArticleModelTest.php | Refactors relationship assertions into a single chained expectation. |
| tests/Feature/AdminUserManagementTest.php | Improves payload helper PHPDoc/typing and null handling. |
| tests/Feature/AdminSeasonManagementTest.php | Improves payload helper PHPDoc typing. |
| tests/Feature/AdminMediaManagementTest.php | Adjusts fake upload MIME typing and payload helper PHPDoc typing. |
| tests/Feature/AdminLocationManagementTest.php | Improves payload helper PHPDoc typing. |
| tests/Feature/AdminEventManagementTest.php | Improves payload helper PHPDoc typing. |
| tests/Feature/AdminArticleManagementTest.php | Refactors expectations and improves payload helper PHPDoc typing. |
| tests/Browser/AdminMediaLibraryTest.php | Tightens browser helper typing for Pest Browser API. |
| rector.php | Adds Rector config to enforce Pest coding style on tests. |
| phpstan.neon | Enables Pest PHPStan extension and includes tests/ in analysis. |
| composer.json | Upgrades Pest dependencies, adds Agent/PHPStan/Rector, adds scripts for rector + tia. |
| composer.lock | Locks upgraded dependency graph for Pest 5/PHPUnit 13 and added tooling. |
| CLAUDE.md | Updates documented tool versions and adds Pest Agent guidance. |
| AGENTS.md | Updates documented tool versions and adds Pest Agent guidance. |
| boost.json | Registers the Pest Agent package and skill for the agent environment. |
| .github/workflows/tia-baseline.yml | Adds workflow to generate and upload the shared TIA baseline artifact. |
| .github/workflows/tests.yml | Runs CI coverage via ./vendor/bin/pest instead of php artisan test. |
| .github/workflows/lint.yml | Adds CI check to enforce rector (test refactoring) dry-run. |
| .github/skills/pest-testing/SKILL.md | Updates skill docs from Pest 4 to Pest 5 (incl. TIA/sharding). |
| .github/skills/pest-plugin-agent/SKILL.md | Adds new skill doc for Pest Agent one-shot verification. |
| .ddev/config.yaml | Adds gh to the DDEV web image packages to support host-driven TIA auth flow. |
| .ddev/commands/host/tia | Adds ddev tia wrapper to bridge GH auth + Xdebug coverage into the container. |
| .claude/skills/pest-testing/SKILL.md | Mirrors Pest 5 skill doc updates for Claude skill set. |
| .claude/skills/pest-plugin-agent/SKILL.md | Mirrors Pest Agent skill doc for Claude skill set. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ddev tiato securely bridge host GitHub authentication and temporary Xdebug coverage into DDEVtoBeEmail(),toBeFile(),toHaveSameSize(), andtoContainOnlyInstancesOf()Why
Pest 5 provides first-party test impact analysis, stronger static analysis, automated test refactoring, agent verification, and new expectations. This upgrade adopts those capabilities while preserving the existing Laravel, feature, and browser test coverage.
Developer impact
composer testfor the complete PHP quality pipelinecomposer test:browserfor the Chromium suiteddev tiafor affected-test runs backed by the sharedpest-tia-baselineworkflow artifactmain, daily, or via manual dispatchValidation
composer test— 349 tests passed, 3,442 assertionscomposer test:browser— 56 tests passed, 854 assertions