Skip to content

Upgrade test suite to Pest 5 - #34

Merged
klaasnicolaas merged 2 commits into
mainfrom
codex/pest-5-upgrade
Jul 29, 2026
Merged

Upgrade test suite to Pest 5#34
klaasnicolaas merged 2 commits into
mainfrom
codex/pest-5-upgrade

Conversation

@klaasnicolaas

Copy link
Copy Markdown
Member

Summary

  • upgrade Pest and maintained plugins to Pest 5 on PHPUnit 13
  • add the Pest Agent, PHPStan, and Rector plugins and modernize the existing test suite
  • include tests in PHPStan analysis and enforce Pest Rector checks in CI
  • configure TIA with a shared GitHub Actions baseline
  • add ddev tia to securely bridge host GitHub authentication and temporary Xdebug coverage into DDEV
  • adopt Pest 5 expectations such as toBeEmail(), toBeFile(), toHaveSameSize(), and toContainOnlyInstancesOf()

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

  • use composer test for the complete PHP quality pipeline
  • use composer test:browser for the Chromium suite
  • use ddev tia for affected-test runs backed by the shared pest-tia-baseline workflow artifact
  • the TIA baseline workflow runs after changes reach main, daily, or via manual dispatch

Validation

  • composer test — 349 tests passed, 3,442 assertions
  • composer test:browser — 56 tests passed, 854 assertions
  • PHPStan — 0 errors, including tests
  • Rector dry run — no pending changes
  • Pint — passed
  • Composer validation — passed
  • Pest Agent one-shot verification — passed
  • DDEV TIA wrapper syntax and Xdebug lifecycle — passed

@klaasnicolaas
klaasnicolaas marked this pull request as ready for review July 29, 2026 14:41
Copilot AI review requested due to automatic review settings July 29, 2026 14:41

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread tests/Feature/PublicProjectPagesTest.php
Comment thread tests/Feature/PublicEventPagesTest.php
@klaasnicolaas
klaasnicolaas merged commit ef6904a into main Jul 29, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants