pestphp/pest
56.2
Adequate · 26 September 2026
23.1k
lines of production code
PHP
primary language
3
measurements over time
What this system is
This system is the Pest v5 testing framework for PHP, providing a modern, plugin-based architecture for executing and managing unit and integration tests. It enhances the underlying PHPUnit engine with advanced features such as parallel execution, Test Impact Analysis for targeted test runs, and snapshot testing. The framework also enforces code quality through built-in architectural presets and offers rich CLI output with CI integrations like TeamCity and JUnit.
How it got here
2020 — Pest v5 plugin architecture and modernization
32 changes.
This period focused on the major release of Pest v5, introducing a modular plugin-based architecture to replace the previous monolithic action classes. The work involved modernizing the codebase for PHP 8.4 and PHPUnit 13, refactoring internal execution logic, and adding new features such as parallel execution, test impact analysis, and snapshot testing.
2021–2023 — Architecture testing and parallel execution overhaul
45 changes.
This period focused on expanding the framework's architectural testing capabilities with new expectations for classes, methods, and enums, while significantly refactoring the parallel testing engine to replace ParaTest with a custom implementation. Concurrently, the codebase introduced modular bootstrapping, dedicated test lifecycle classes, and enhanced CI/CD integrations including TeamCity logging and Test Impact Analysis support.
2024–2026 — Test Impact Analysis and Architectural Presets
37 changes.
This period focused on introducing Test Impact Analysis (TIA) to enable targeted test execution by tracking file changes and dependencies across various frameworks. It also added built-in architectural presets to enforce code standards and enhanced test output with contextual metadata like issue links and assignees.
Features
Add GitLab CI baseline support alongside existing GitHub support
The TIA (Test Impact Analysis) plugin now supports GitLab CI baselines in addition to the existing GitHub support. This change introduces a new \GitLabRemote\ implementation that uses the \glab\ CLI to detect successful pipeline runs, retrieve artifact sizes, and download baseline artifacts for GitLab-hosted repositories. The \BaseRemote\ abstract class provides shared logic for CLI detection, authentication status checks, error classification, and Git remote URL parsing, while \GitHubRemote\ continues to handle GitHub-specific workflows using the \gh\ CLI. Users with GitLab repositories can now leverage baseline comparisons for test impact analysis.
src/Plugins/Tia/Baselines · high confidence
Add IgnorableTestCase base class
A new \IgnorableTestCase\ class has been added to the \Pest\\TestCases\ namespace, extending \PHPUnit\\Framework\\TestCase\. This class serves as a base for test cases that can be ignored, providing a structured way to handle test exclusion within the testing framework.
src/TestCases · high confidence
Add fingerprinting for npm package-lock.json files
A new \PackageLock\ class has been added to the TIA lockfiles plugin to handle npm \package-lock.json\ files. It implements the \Lockfile\ contract by generating a deterministic fingerprint (using xxh128) of the lockfile's contents. The implementation specifically excludes platform-specific dependencies (those with \os\, \cpu\, or \libc\ metadata) and packages bundled under platform-specific paths to ensure consistent fingerprinting across different environments.
src/Plugins/Tia/Lockfiles · high confidence
Added Git dirty and TIA test case filters
Two new test case filters have been introduced to allow running tests based on specific change contexts. The GitDirtyTestCaseFilter enables running only tests affected by uncommitted or staged changes by detecting modified PHP files via Git status, throwing an error if no dirty tests are found. The TiaTestCaseFilter supports Test Impact Analysis by accepting only test files identified as affected by code changes through a provided dependency graph, allowing for more targeted test execution in large codebases.
src/TestCaseFilters · high confidence
Added ReplayType enum for mapping test statuses
A new ReplayType enum has been introduced in the Tia plugin to categorize test outcomes. It provides a static method, fromStatus, that maps PHPUnit TestStatus objects to specific replay types such as Pass, Failure, Risky, Skipped, or Incomplete, allowing the plugin to distinguish between different test result states for replay logic.
src/Plugins/Tia/Enums · high confidence
Added TIA integration hooks for Blade views and Inertia.js components
New integration classes have been added to automatically record source file paths for Laravel Blade views and Inertia.js component names during test runs. The Blade integration hooks into the view factory to link source files for all rendered views, while the Inertia integration listens for the RequestHandled event to extract and record component data from both JSON responses and HTML-rendered Inertia pages.
src/Plugins/Tia/Edges · high confidence
Added code coverage cache warming command and skipped test output handling
The TextUI now includes a new \WarmCodeCoverageCacheCommand\ that allows users to pre-warm the static analysis cache for code coverage, improving subsequent test run performance by avoiding redundant analysis. Additionally, the progress printer now supports a specific subscriber for skipped tests: when a test is skipped with the message '\_\TODO\\_', the printer outputs a 'T' indicator in the progress bar, providing visual feedback for tests marked as temporary todos.
overrides/TextUI/Output · high confidence
Added empty Any matcher class
A new stub class \Any\ has been added to the \Pest\\Matchers\ namespace. Currently, this class is empty and marked as internal, serving as a placeholder for future matcher functionality.
src/Matchers · high confidence
Added external snapshot testing support
Users can now write snapshot tests outside the standard tests directory using the \toMatchSnapshot\ assertion. The new \tests-external/Features/Expect/toMatchSnapshot.php\ file demonstrates that snapshots generated in external locations are correctly saved to the \tests/.pest/snapshots-external/\ directory, ensuring proper isolation and organization for external test suites.
tests-external/Features/Expect · high confidence
Added snapshot update skill and project documentation
The project now includes a new 'snapshots-update' skill for AI agents, which provides a structured workflow to regenerate test snapshots and fix integration tests when test counts or outputs change. This entry also adds the project's main documentation (PROJECT.md) describing the Pest testing framework's structure and a lockfile (.hod/lock) to ensure the immutability of the agent skills.
.hod · high confidence
Adds PHPUnit event subscribers for TIA, TeamCity, and shard timing
This change introduces a suite of new subscriber classes in the src/Subscribers directory to integrate Pest with external tooling and internal optimizations. It adds TIA (Test Impact Analysis) support by recording test results, assertions, and deprecations via the ResultCollector and Recorder, while also enforcing that TIA runs only Pest tests. It enables TeamCity logging when the --teamcity flag is used, ensuring output is properly formatted for CI pipelines. Additionally, it implements shard timing collection to track test durations for optimization and ensures ignorable test cases are correctly filtered out during execution.
src/Subscribers · high confidence
Adds framework-specific file-watch defaults for TIA
Introduces a new set of watch-default plugins for the TIA (Test Integration Architecture) system that automatically configure file watching based on the detected framework. New classes in src/Plugins/Tia/WatchDefaults provide sensible defaults for Laravel, Symfony, Livewire, Inertia, Browser (Pest plugin), and general PHP environments, mapping relevant source directories (such as views, migrations, config, and assets) to trigger test runs when changed.
src/Plugins/Tia/WatchDefaults · high confidence
Adds new UI components for badges and detail layouts
Introduces three new Blade view components in the resources/views/components directory: a badge component that displays colored labels (blue for INFO, red for ERROR, yellow for WARN, green for SUCCESS) alongside content, a two-column detail component for rendering left/right key-value pairs with a dotted separator, and a new-line component for spacing.
resources/views/components · high confidence
Adds support for scoped expectations and higher-order chaining
This change introduces new \EachExpectation\ and \HigherOrderExpectation\ classes to the \src/Expectations\ directory, enabling more advanced assertion patterns. Users can now use the \scoped\ method to apply expectations to nested structures (such as JSON data) and leverage improved higher-order chaining for cleaner test syntax. The \EachExpectation\ class specifically allows assertions to be applied to every item in an iterable value, while \HigherOrderExpectation\ manages the state for these chained operations, including support for the \not\ modifier and JSON parsing within the chain.
src/Expectations · high confidence
Initial TeamCity logging subscriber support
Added a new set of subscriber classes in the \src/Logging/TeamCity/Subscriber\ directory to enable TeamCity service messages for test events. These subscribers (e.g., \TestFailedSubscriber\, \TestErroredSubscriber\, \TestFinishedSubscriber\) implement PHPUnit's event subscriber interfaces to forward test lifecycle events to the \TeamCityLogger\, allowing CI/CD pipelines using TeamCity to receive structured test results.
src/Logging/TeamCity, src/Logging/TeamCity/Subscriber · high confidence
Introduce Logging Converter for Test Output Formatting
Added a new \Converter\ class in \src/Logging\ that transforms PHPUnit event data into human-readable strings for test reports. This component handles the prettification of test case names and locations, formats exception messages and stack traces with relative paths, and extracts test suite metadata, enabling consistent and readable logging output for users.
src/Logging · high confidence
Introduce TIA contract interfaces for CI, state, and lockfile management
Added a set of internal interfaces in the TIA plugin contracts to define the structure for CI integration, state persistence, and lockfile handling. The new \Ci\ interface standardizes how the current and default branches are detected, with concrete implementations provided for GitHub (reading from environment variables and event payloads) and GitLab (reading from environment variables). The \State\ interface defines methods for reading, writing, and deleting key-value state, while the \Lockfile\ interface specifies how to determine if a filename applies and how to generate a content fingerprint. Additionally, the \WatchDefault\ interface outlines how to determine applicable watch modes and retrieve default test directories based on project structure.
src/Plugins/Tia/Contracts · high confidence
Introduces Describable trait for managing test descriptions
Adds the Describable trait to the PendingCalls/Concerns namespace, providing a structured way to track test descriptions via the $\_\_describing and describing arrays. This enables the framework to associate pending test calls with specific descriptive contexts, supporting improved logic around test hooks and descriptions as indicated by the commit history.
src/PendingCalls/Concerns · high confidence
Introduces Test Impact Analysis (TIA) plugin for targeted test execution
Adds a new TIA plugin that enables targeted test execution by analyzing file changes and test dependencies. The plugin includes a baseline synchronization system supporting both GitHub and GitLab CI to fetch and publish test baselines, a file change detection engine that tracks content hashes and git diffs, and a dependency graph builder that maps tests to source files (including Blade, Livewire, and Inertia components). It also features coverage merging to combine current and cached coverage data, and a fingerprinting system to detect structural and environmental drifts in the project setup.
src/Plugins/Tia · high confidence
Introduces argument-handling trait for plugin commands
Adds the HandleArguments trait to src/Plugins/Concerns, providing utility methods (hasArgument, pushArgument, popArgument, popArgumentValue) for managing CLI arguments in plugins. This enables plugins to inspect, add, and remove command-line arguments, including handling key-value pairs and duplicate entries, which supports features like --parallel and --exclude-group.
src/Plugins/Concerns · high confidence
Introduces built-in architectural presets for enforcing code standards
Adds a new \src/ArchPresets\ module providing pre-configured sets of architectural expectations. This includes a \Laravel\ preset that enforces conventions such as suffixes for controllers, requests, and commands, ensures proper inheritance from framework classes, and restricts the use of debugging functions like \dd\ and \dump\. It also provides \Strict\ and \Relaxed\ presets to enforce or relax coding standards like strict types and class finality across user namespaces, a \Security\ preset to ban dangerous functions (e.g., \eval\, \md5\), a \Php\ preset to ban debugging and deprecated functions, and a \Custom\ preset to allow user-defined rules.
src/ArchPresets · high confidence
Introduces internal support utilities and refactors higher-order testing infrastructure
This change adds a suite of new internal support classes to src/Support, including Arr, Ci, Closure, Container, Coverage, DatasetInfo, Description, ExpectationPipeline, Exporter, Git, HigherOrderCallables, HigherOrderTapProxy, Shell, StateGenerator, and View, to provide foundational helpers for array manipulation, CI detection, dependency injection, code coverage reporting, dataset scoping, and shell integration. It simultaneously refactors the higher-order testing mechanism by updating Backtrace to use a robust backtrace filtering method, modifying HigherOrderMessage to support conditional execution and callable expectations, and enhancing Reflection to handle \_\_call magic methods and bind callables with test data, thereby improving the reliability and flexibility of higher-order test chains.
src/Support · high confidence
Introduction of Expectation mixin class with comprehensive assertion methods
The \src/Mixins/Expectation.php\ file introduces a new \Expectation\ mixin class that provides a wide range of assertion methods for testing values. This includes basic checks like \toBe\, \toBeEmpty\, \toBeTrue\, \toBeFalse\, and their truthy/falsy variants. It also adds comparison methods such as \toBeGreaterThan\, \toBeLessThan\, and their 'or equal' counterparts, which now support \DateTimeInterface\ in addition to numeric types. The class introduces collection-like assertions including \toContain\ (for strict containment) and \toContainEqual\ (for value equality), as well as string-specific methods like \toStartWith\. This mixin extends the testing capabilities by allowing these expectations to be mixed into the main \Pest\\Expectation\ class, enabling fluent, chainable assertions in tests.
src/Mixins · high confidence
New WritesToConsole trait for structured test output
A new WritesToConsole trait has been added to the Logging concerns, providing helper methods to write success, error, and warning messages to the console with specific colors and symbols. This enables consistent, styled output for test results directly from the logging subsystem.
src/Concerns/Logging · high confidence
New compact parallel test output printer
A new CompactPrinter class has been added to the parallel support plugin to provide a condensed, symbol-based view of test progress during parallel execution. This printer displays colored icons for different test outcomes (such as success, failure, or deprecation) in a compact format, and includes a recap section that summarizes parallel process usage and test results at the end of the run.
src/Plugins/Parallel/Support · high confidence
New configuration classes for presets, printing, and project integrations
The \src/Configuration\ directory now includes three new classes: \Presets\ (exposing a \custom\ method to register preset closures), \Printer\ (providing a \compact\ method to toggle compact output via the Collision adapter), and \Project\ (a singleton managing URL patterns for GitHub, GitLab, Bitbucket, Jira, and custom integrations for issues, pull requests, and assignees).
src/Configuration · high confidence
New parallel execution handlers for Laravel, Pest, and general parallel runs
Added three new argument-handling classes in the Parallel plugin to configure test execution modes: the Laravel handler detects Laravel applications and configures the \Illuminate\\Testing\\ParallelRunner\ with appropriate environment variables; the Parallel handler strips legacy parallel flags and sets the runner to \WrapperRunner\; and the Pest handler sets the \PEST\_PARALLEL\ server variable for worker processes.
src/Plugins/Parallel/Handlers · high confidence
New plugin lifecycle interfaces introduced
The plugin system now exposes five new contract interfaces—AddsOutput, Bootable, HandlesArguments, HandlesOriginalArguments, and Terminable—that define the specific lifecycle hooks plugins can implement to interact with the runner's output, boot process, argument handling, and termination phases.
src/Contracts/Plugins · high confidence
New test case filters for assignees, flaky tests, issues, notes, PRs, and todos
Users can now filter test cases by specific metadata attributes. New filter classes have been added to the TestCaseMethodFilters namespace to support filtering by assignee (partial match), flaky status, GitHub issue numbers, notes, and pull request numbers, as well as a filter for tests marked as todo. These filters allow users to narrow down test execution to only those cases matching these specific criteria.
src/TestCaseMethodFilters · high confidence
PHPStan type inference for HigherOrderExpectation properties
A new PHPStan extension has been added to improve static analysis accuracy for Pest's HigherOrderExpectation. This change enables PHPStan to correctly resolve the types of properties accessed on higher-order expectations, providing better type hints and error detection for users writing complex test assertions.
src/PHPStan · high confidence
Pest 5.2.1 introduces a new Kernel architecture and global helper functions
This release upgrades Pest to version 5.2.1 and introduces a new \Kernel\ class that manages the bootstrapping process, plugin lifecycle, and error handling. The global test functions (\test\, \expect\, \describe\, \beforeEach\, etc.) have been moved from \globals.php\ to \Functions.php\ and now utilize a new \Configuration\ class for project settings. The \TestSuite\ has been refactored to include a \SnapshotRepository\ and improved test description handling, while the legacy \Datasets\ class has been removed in favor of the new \DatasetsRepository\. Additionally, a new \Preset\ system allows users to apply architectural constraints via built-in presets like \php\, \laravel\, \strict\, and \security\.
src · high confidence
Pest binary adds test filtering and parallel worker support
The \bin/pest\ entry point now supports several new CLI flags that filter which tests are executed: \--dirty\ (runs only tests related to changed files via Git), \--todo\/\--todos\, \--flaky\, \--notes\, \--assignee\, \--issue\/\--ticket\, and \--pr\/\--pull-request\. It also introduces \--compact\ and \--profile\ for Collision printer output, and \--teamcity\ for CI integration. The binary now correctly resolves the project root based on the autoload path rather than \getcwd()\, and supports a configurable \--test-directory\. Additionally, a new \bin/worker.php\ file enables parallel test execution via ParaTest wrapper workers, and \bin/pest-tia-vite-deps.mjs\ provides Vite/rolldown alias resolution for frontend test integration.
bin · high confidence
Pest v5 introduces a new plugin architecture with built-in support for parallel execution, sharding, and test impact analysis
The \src/Plugins\ directory has been completely rewritten to implement a modular plugin system, replacing the previous \src/Actions\ structure. This change introduces a suite of new built-in plugins that provide native support for parallel testing (\Parallel\), time-based sharding (\Shard\), and Test Impact Analysis (\Tia\). It also adds dedicated plugins for new CLI features such as \--bail\ (stopping on first failure), \--retry\ (re-running failed tests), \--memory\ (displaying memory usage), and \--profile\ (profiling test execution). The \Coverage\ plugin has been moved into this core system to handle coverage reporting and minimum threshold enforcement, while the \Init\ plugin now manages project scaffolding. Additionally, the \Snapshot\ plugin enables snapshot testing capabilities, and the \Configuration\ plugin handles automatic generation of temporary PHPUnit configuration files.
src/Plugins · high confidence
Pest v5 release with simplified agent instructions and modernized tooling
This release introduces v5 of the Pest testing framework, featuring new documentation files (AGENTS.md, CLAUDE.md) that provide strict instructions for coding agents to follow ASD-STE100 Simplified Technical English. The project has migrated from PHP-CS-Fixer to Laravel Pint for code formatting, replacing the .php\_cs file with pint.json. Static analysis has been upgraded to PHPStan level 7, supported by new extension configuration files (phpstan-pest-extension.neon) and a baseline file. The PHPUnit configuration has been updated to version 10.0 schema, enabling stricter test behaviors like failing on risky tests and warnings, and adding support for external test directories. Additionally, a Makefile and Docker setup have been added to simplify local development and testing.
(repo-wide) · high confidence
Test output now displays assignees, issues, and PRs in test descriptions
The test runner now enriches test descriptions in the console output with contextual metadata. When test context includes assignees, issues, or pull requests, these are rendered as clickable links (using configured base URLs) appended to the test name. Additionally, any associated notes are displayed below the test result. This provides immediate visibility into who is responsible for a test and which related tickets or PRs it addresses, directly within the test output.
src/Collision · high confidence
Removals
Removal of Laravel-specific Pest console commands
The \pest:dataset\, \pest:install\, and \pest:test\ Artisan commands have been removed from the \src/Laravel/Commands\ directory. These commands previously allowed users to generate dataset files, install Pest configuration stubs, and create new test files directly within Laravel applications; their removal means these code-generation capabilities are no longer available in this package location.
src/Laravel/Commands · high confidence
Removed PHP script for compiling PHPUnit assertion functions
The \scripts/compile.php\ file has been deleted. This script previously processed the PHPUnit \Functions.php\ source to generate a standalone \compiled/globals.php\ file by modifying namespaces and removing unused imports. Its removal eliminates the ability to generate this specific compiled assertion helper file.
scripts · high confidence
Architecture
Introduces modular bootstrapper architecture for test environment initialization
The \src/Bootstrappers\ directory now contains a set of dedicated bootstrapper classes that replace the previous monolithic initialization logic. \BootExcludeList\ registers specific directories (bin, overrides, resources, src, stubs) with PHPUnit's exclude list. \BootFiles\ handles loading the test structure (Expectations, Helpers, Pest.php) and dataset files, while also throwing a fatal exception if the test directory is missing. \BootOverrides\ loads patched PHPUnit classes from the \overrides\ directory to ensure compatibility. \BootPhpUnitConfiguration\ builds the PHPUnit configuration, \BootSubscribers\ registers Pest's event subscribers (including TeamCity and Tia support), \BootKernelDump\ enables kernel dumping for debugging, and \BootView\ configures the console output renderer. This change restructures how Pest initializes its environment, making the boot process more modular and maintainable.
src/Bootstrappers · high confidence
Behavioural changes
Adds dedicated views for CLI usage and version output
The application now uses dedicated Blade templates to render command-line help and version information. A new \usage.php\ view formats the usage string (e.g., \pest \<file\> \[options\]\) with specific styling, while a new \version.php\ view displays the Pest Testing Framework version number. This change separates the presentation logic for these two distinct CLI outputs from the main application flow.
resources/views · high confidence
Filtered test progress output in ParaTest runner
The ParaTest runner now uses a custom progress printer that suppresses noisy output such as blank lines, whitespace-only lines, and standard progress indicators (e.g., '1 / 10 (10%)'). This ensures that only significant test results (errors, failures, skips, etc.) and other meaningful output are displayed to the user, reducing visual clutter during test runs.
overrides/ParaTest · high confidence
Improved exception trace reporting for Collision-renderable errors
The test runner now includes the specific file and line number of the source of an exception in the reported trace when that exception implements the Collision editor interface. This ensures that error output for such exceptions is more precise and easier to debug by highlighting the exact location where the error originated.
overrides/Event · high confidence
Installer now guides users to install Pest Plugin Browser and Playwright
The installer UI now displays a specific instruction panel when the \visit()\ function is used, informing users that the Pest Plugin Browser is required. It provides clear, copy-pasteable commands to install the \pestphp/pest-plugin-browser:^5.0\ package via Composer and set up Playwright via npm, ensuring users can resolve missing dependencies for browser-based testing features.
resources/views/installers · high confidence
Introduce PCOV and Xdebug restarter classes for TIA integration
Added \PcovRestarter\ and \XdebugRestarter\ classes in \src/Restarters\ to handle process restarts when using the TIA (Tracing Instrumentation Architecture) feature. The \PcovRestarter\ ensures the \pcov.directory\ INI setting matches the project root before running, preventing memory exhaustion issues during TIA graph generation. The \XdebugRestarter\ leverages \Composer//XdebugHandler\ to restart the process if Xdebug is loaded in coverage-only mode and TIA is enabled, ensuring consistent execution context for mutation testing and coverage analysis.
src/Restarters · high confidence
Introduces dedicated classes for tracking covered classes and functions
Added \CoversClass\ and \CoversFunction\ classes to the \Pest\\Factories\\Covers\ namespace. These new internal types provide structured containers for storing the names of covered classes and functions, replacing the previous approach of using simple strings or annotations directly in factory definitions. This change supports the broader shift to always use attributes instead of annotations for cover declarations.
src/Factories/Covers · high confidence
Introduces snapshot testing and refactors hook and dataset repositories
This change adds new internal repositories for snapshot testing (Snapshot, SnapshotRepository) and scoped datasets (DatasetsRepository), enabling users to assert against persisted file outputs and use datasets scoped to specific file paths. It also refactors the BeforeEach and AfterEach repositories to support chaining multiple hooks per test file instead of throwing exceptions on duplicates, and updates the TestRepository to use a new filter-based architecture for test case selection.
src/Repositories · high confidence
Introduction of internal contract interfaces and refactoring of HasPrintableTestCaseName
This change introduces several new internal contract interfaces in the src/Contracts directory to define specific behaviors and filters for the testing framework, including ArchPreset, Bootstrapper, Panicable, Restarter, TestCaseFilter, and TestCaseMethodFilter. Additionally, the existing HasPrintableTestCaseName interface has been refactored to directly extend the base interface from the NunoMaduro\\Collision library, removing previous conditional logic that checked for the interface's existence.
src/Contracts · high confidence
Override PHPUnit JUnit XML Logger with Pest integration
The JUnit XML logging output for test suites has been replaced with a custom implementation that integrates with the Pest testing framework. This change modifies how test results are aggregated and reported in XML format, leveraging Pest's internal converter and test suite context to provide more accurate or framework-specific metadata in the generated logs.
overrides/Logging · high confidence
Overrides PHPUnit runner components for custom test loading and history management
The \overrides/Runner\ directory now contains custom implementations of PHPUnit's core runner classes: \TestSuiteLoader\, \TestSuiteSorter\, and \DefaultTestRunHistory\. The new \TestSuiteLoader\ modifies how test classes are discovered and loaded, specifically handling integration with Pest's test case structures and preventing duplicate test loading. \DefaultTestRunHistory\ introduces a file-based caching mechanism (\.phpunit.result.cache\) to persist test status and execution times, enabling features like running failed tests first. \TestSuiteSorter\ is overridden to support reordering tests based on duration, size, and defect history, integrating with the new history system to prioritize unstable or slow tests.
overrides/Runner · high confidence
Pest 'only' mode integration in test suite filtering
The test suite filtering logic in the TextUI component has been updated to recognize and respect Pest's 'only' mode. When the \Only::isEnabled()\ flag is active, the processor now automatically adds an include group filter for the specific 'only' group, ensuring that only tests marked for exclusive execution are run. This change integrates Pest's selective execution feature directly into the PHPUnit test suite processing pipeline, allowing users to leverage Pest's \test.only\ functionality without manual configuration overrides.
overrides/TextUI · high confidence
Refactored test lifecycle hooks and describe blocks into dedicated PendingCall classes
The internal implementation of test lifecycle hooks (beforeEach, afterEach) and describe blocks has been restructured into dedicated classes (BeforeEachCall, AfterEachCall, DescribeCall) within the PendingCalls directory. This change introduces a new scoping mechanism where hooks are now strictly bound to their containing describe block context, ensuring that beforeEach and afterEach functions are executed only for tests within the matching describe scope and preventing interference between nested or similarly named describe blocks. Additionally, the BeforeEachCall class now supports chaining test-call methods (like \with\ or \group\) alongside test-case hooks, allowing for more granular configuration of setup logic relative to specific test definitions.
src/PendingCalls · high confidence
Refactors test case generation to use dedicated method factories and PHP 8 attributes
The test generation logic in src/Factories has been restructured to separate test case definitions from individual test methods. A new TestCaseMethodFactory class now handles the creation of specific test methods, including their closures, descriptions, and attributes, while the TestCaseFactory manages the overall test class structure and delegates method evaluation to the new factory. This change introduces a new Attribute class to represent PHP 8 attributes, replacing previous annotation-based or string-based attribute handling. The refactoring improves type safety and aligns the codebase with modern PHP standards, specifically supporting PHP 8 features and PHPUnit 9.3+ attribute syntax. Users will benefit from more robust test generation, better handling of datasets and dependencies, and improved compatibility with newer PHP and PHPUnit versions.
src/Factories · high confidence
Refactors test execution internals and introduces expectation extension API
The test case execution logic in src/Concerns has been restructured: the previous TestCase trait is removed and replaced by a new Testable trait that manages hooks (beforeAll, afterAll, beforeEach, afterEach) and test execution, alongside new traits for expectations (Expectable), extension registration (Extendable), and pipeline/interception (Pipeable). This introduces a new expect() helper and an extend() mechanism for adding custom expectation methods, while the pipe/intercept system allows modifying or intercepting expectation values. The Attributes evaluator is also added to generate PHP attribute code for test definitions.
src/Concerns · high confidence
Refined exception messages and new validation errors for hooks, datasets, and Tia mode
The exception classes in src/Exceptions have been rewritten to provide clearer, more actionable error messages for users. Hook validation errors (beforeAll, afterAll, before, after) now explicitly state scope restrictions (e.g., before/after hooks must be outside describe blocks, or chained correctly). Dataset errors (missing, mismatched, duplicate) now specify required argument counts and registration scopes. New exceptions cover Tia mode requirements (remote, default branch, repository root, commit presence, Pest-only tests) and general validation (invalid test class names, static closures, missing descriptions). Several exceptions were renamed or repurposed to match their new responsibilities (e.g., BeforeEachAlreadyExist → AfterAllWithinDescribe, CodeCoverageDriverNotAvailable → MissingDependency).
src/Exceptions · high confidence
Removal of Laravel Pest Service Provider
The \PestServiceProvider\ class has been removed from the Laravel integration. This means the automatic registration of the \PestInstallCommand\, \PestTestCommand\, and \PestDatasetCommand\ artisan commands via the service provider is no longer performed by this file, likely shifting command registration responsibilities elsewhere or requiring manual configuration.
src/Laravel · high confidence
Removal of PHPUnit assertion functions from compiled globals
The \compiled/globals.php\ file, which previously provided global wrapper functions for PHPUnit assertions (such as \assertArrayHasKey\, \assertEquals\, and \assertContains\), has been deleted. This change removes the availability of these convenience functions, meaning tests can no longer rely on these global helpers and must use the \Assert\ class methods directly.
compiled · high confidence
Removal of legacy PendingObjects classes
The \AfterEachCall\, \BeforeEachCall\, \TestCall\, and \UsesCall\ classes in \src/PendingObjects\ have been removed. This change eliminates the previous pending-object pattern used for chaining test definitions and lifecycle hooks, indicating a shift in how the framework handles test construction and hook registration internally.
src/PendingObjects · high confidence
Removes internal action classes for test loading and validation
The internal action classes in src/Actions (AddsCoverage, AddsTests, LoadStructure, ValidatesConfiguration, ValidatesEnvironment) have been deleted. This removes the specific logic previously used to parse coverage options, group test cases into suites, load the Pest structure (Pest.php, Datasets), validate PHPUnit configuration, and check for required environment files like composer.json and the tests directory.
src/Actions · high confidence
Replaces ParaTest runner with custom parallel execution and output handling
The parallel testing engine in \src/Plugins/Parallel/Paratest\ has been replaced with a custom implementation consisting of \WrapperRunner\, \ResultPrinter\, and \CleanConsoleOutput\. This change introduces a new \WrapperRunner\ that manages worker processes, handles specific environment configurations like Laravel Herd, and coordinates test execution. A new \ResultPrinter\ replaces the default ParaTest printer to provide custom parallel output, including support for TeamCity logs, testdox, and compact progress reporting, while \CleanConsoleOutput\ filters out specific PHPUnit banner messages from the console output.
src/Plugins/Parallel/Paratest · high confidence
Reworks console help display and removes legacy command/coverage classes
The console help output now explicitly lists Pest-specific options (such as --init, --coverage, --min, and --group) via a new Help class, while the previous Command and Coverage classes have been removed from the src/Console directory, indicating a shift in how the CLI entry point and coverage reporting are structured.
src/Console · high confidence
Support for dataset range filtering in test name matching
The test runner's name filter now supports filtering by dataset index ranges. When a test name matches the provided filter pattern, the system checks if the last captured group corresponds to a dataset index and verifies that it falls within the specified minimum and maximum bounds, allowing users to target specific iterations of data-driven tests.
overrides/Runner/Filter · high confidence
Updated Laravel test scaffolding to use Pest and PHPUnit 10.3
The \init\ command now generates test stubs using Pest as the primary testing framework, including a new \Pest.php\ configuration file and Pest-style example tests in \Feature\ and \Unit\ directories. The \phpunit.xml\ configuration has been updated to align with PHPUnit 10.3 standards, featuring corrected indentation, the removal of self-closing tags, and the inclusion of environment variables for testing (such as \CACHE\_STORE\ and \SESSION\_DRIVER\). A standard \TestCase.php\ stub is also provided to support the testing infrastructure.
stubs/init, stubs/init-laravel · high confidence
Updated test stubs to use Pest assertions and Dusk template
The default test stubs have been updated to align with modern testing practices. The Unit test stub now uses Pest's \expect(...)-\>toBeTrue()\ syntax instead of the legacy \assertTrue()\ helper. Additionally, a new Browser stub has been introduced to provide a template for Laravel Dusk browser tests, while the previous phpunit.xml configuration file has been removed, indicating a shift away from standard PHPUnit configuration in favor of Pest's conventions.
stubs · high confidence
Fixes
Ensures test cases are initialized before execution
A new filter in the test runner ensures that test cases implementing the HasPrintableTestCaseName contract are initialized via \_\_initializeTestCase() before being accepted for execution, addressing issues with filtering tests.
src/Runner · high confidence
Test coverage
Added comprehensive test coverage for new test runner features; Added feature tests for TIA branch baselines and CI integration; Added snapshot for collision test fixture; Added snapshot test coverage for Expect and Flaky features; Added snapshot test for help command output; Added snapshot tests for Expect toMatchSnapshot with datasets; Added snapshot tests for Todo and CustomTestCase features; Added test fixture for ToHavePublicMethodsBesides; Added test fixtures for TIA baseline integration; Added test fixtures for TIA overlay configurations; Added test fixtures for ToHaveAttribute expectations; Added test fixtures for ToHaveMethod architectural expectation; Added test fixtures for backed enum expectations; Added test fixtures for casing validation; Added test fixtures for class inheritance scenarios; Added test fixtures for code coverage analysis; Added test fixtures for constructor and destructor architecture checks; Added test fixtures for inherited and nested trait detection; Added test fixtures for invokable class detection; Added test fixtures for parallel nested dataset reporting; Added test fixtures for strict equality architecture rules; Added test fixtures for strict types enforcement; Added test fixtures for suite validation and TIA replay scenarios; Added test for PCOV restarter memory limit preservation; Added test for console help output and removed coverage test; Added test results cache for Pest framework; Added tests for Higher Order Expectations on methods and properties; Added tests for OppositeExpectation error message handling; Added tests for code coverage attribute handling; Added tests for custom affixes and trait application; Added tests for global and nested hook execution order; Added tests for non-standard test file naming conventions; Added tests for plugin coverage calculation and global uses registration; Added tests for scoped dataset resolution in Pest; Added unit test for Collision editor integration in stack traces; Added unit tests for Environment, Retry, and Shard plugins; Added unit tests for Pest support utilities; Added unit tests for configuration helpers; Added unit tests for dataset descriptions, presets, test naming, and test suite validation; Added unit tests for the HandleArguments plugin concern; Added unit tests for the TIA plugin internals; Adds internal test suite for architecture, hooks, and environment validation; Expanded test coverage for Expectation API; Expanded visual snapshot tests for CLI output and parallel execution; Refactors PHPUnit test infrastructure; Removed unit tests for Actions module; Updated help command snapshot for Pest 5.2.1; Updated test snapshots for new features and fixes; Updated test suite to use PHPUnit attributes and Pest configuration; Updated test suite to use Pest expectation API.
Dependencies
Pest 5.x major upgrade: PHP 8.4, PHPUnit 13, and plugin-based architecture
This release upgrades the framework to require PHP 8.4 and PHPUnit 13.3.4, replacing the previous Collision dependency with Collision 8.9.5 and Termwind 2.4.0. The architecture shifts to a plugin-based model, explicitly registering plugins like Mutate, Coverage, and Parallel in the composer configuration, and introduces new dev tools (Pest Dev Tools, Browser, Type Coverage) while removing legacy Laravel service provider wiring.
(dependencies) · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Score
- CAI 50 → 56 (+6.6)
- Rubric changed (rubric-2026.08.15 → rubric-2026.09.15) — scores are not directly comparable.
Lenses
- Code Health 94 → 88 (-5.2)
- Architecture 94 → 96 (+2.3)
- Maturity 40 → 38 (-2.1)
- Readiness 30 → 53 (+23.0)
- Security 93 → 94 (+1.2)
Resolved (15)
- Coverage not measured — test suite did not build
- Dimension evaluation failed
- Duplicated block (10 lines × 2) (src/ArchPresets/Laravel.php)
- Duplicated block (11 lines × 2) (src/Plugins/Tia.php)
- Duplicated block (12 lines × 2) (src/PendingCalls/TestCall.php)
- Duplicated block (14 lines × 2) (src/Plugins/Tia/JsModuleGraph.php)
- Duplicated block (24 lines × 3) (src/Plugins/Help.php)
- Duplicated block (31 lines × 2) (src/ArchPresets/Php.php)
- Duplicated block (9 lines × 2) (src/Plugins/Tia.php)
- Duplicated block (9 lines × 2) (src/Support/Reflection.php)
- Low IaC: DS-0026 (docker/Dockerfile)
- No explanation of what Pest is and how to install/run the tests. (README.md)
- No exposed public API
- No tests found
- Test reliability not included
New (114)
- Boundary-crossing change coupling: TestCaseMethodFactory.php ↔ ChainableClosure.php (src/Factories/TestCaseMethodFactory.php)
- Boundary-crossing change coupling: TestCaseMethodFactory.php ↔ DescribeCall.php (src/Factories/TestCaseMethodFactory.php)
- Browser.detectBrowserTestTargets (cognitive 19) (src/Plugins/Tia/WatchDefaults/Browser.php)
- Change coupling: AfterEachCall.php ↔ BeforeEachCall.php (src/PendingCalls/AfterEachCall.php)
- Change coupling: Converter.php ↔ ServiceMessage.php (src/Logging/Converter.php)
- Change coupling: Graph.php ↔ Recorder.php (src/Plugins/Tia/Graph.php)
- ClassTooLong: Expectation (src/Expectation.php)
- ClassTooLong: Expectation (src/Mixins/Expectation.php)
- ClassTooLong: Graph (src/Plugins/Tia/Graph.php)
- ClassTooLong: Tia (src/Plugins/Tia.php)
- Coverage.handleArguments (cognitive 17) (src/Plugins/Coverage.php)
- Coverage.report (cognitive 25) (src/Support/Coverage.php)
- Coverage.report (cyclomatic 16) (src/Support/Coverage.php)
- CoverageCollector.perTestFiles (cognitive 21) (src/Plugins/Tia/CoverageCollector.php)
- CoverageMerger.stripCurrentTestsFromCached (cognitive 17) (src/Plugins/Tia/CoverageMerger.php)
- Dependency hygiene PARTLY measured — Composer dependencies read, no committed lock to grade for currency
- Documentation: no installation or build instructions (README.md)
- Documentation: no project overview (README.md)
- Duplicated block (10 lines × 2) (src/Plugins/Tia.php)
- Duplicated block (11 lines × 2) (src/Plugins/Concerns/HandleArguments.php)
- …and 94 more
Changes since last survey
- 54 commits — 31 feature/other, 23 fixes
By area
- src/Plugins — 23 commits
- (root) — 9 commits
- tests/.pest — 7 commits
- tests/Features — 3 commits
- src/Exceptions — 2 commits
- .github/workflows — 1 commit
- src/Concerns — 1 commit
- src/Factories — 1 commit
- src/Mixins — 1 commit
- src/Repositories — 1 commit
- src/Restarters — 1 commit
- tests/.snapshots — 1 commit
- tests/Fixtures — 1 commit
- tests/Unit — 1 commit
- tests/Visual — 1 commit
Notable commits
- fix: Fix repeat with named dataset arguments (#1769)
- fix: Regression: Command gh not found on Windows - #1895 (#1922)
- fix: chore: ci fixes
- fix: chore: fix version
- fix: chore: fixes ci
- fix: chore: fixes snapshots
- fix: chore: rector fixes (#1898)
- fix: fix
- fix: fix(tia): casing issues
- fix: fix(tia): include the PHP minor version in the fingerprint (#1860)
- fix: fix(tia): persist state on detached HEAD- #1844 (#1891)
- fix: fix(tia): re-anchor after a full suite run without a coverage driver (#1866)
- fix: fix(tia): reuse baselines across replacement CI merge commits (#1923)
- fix: fix(tia): suppress PHPUnit XML coverage during recording (#1845)
- fix: fix(tia): treat a test skipped from a hook as finished (#1863)
- fix: fix: datasets with a single named argument (#1894)
- fix: fix: exit code with --shard and --parallel (#1883)
- fix: fix: fail missing snapshots in CI (#1842)
- fix: fix: key Tia worker partials per process to survive batch recycling (#1782)
- fix: fix: link warning
- …and 34 more
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
pestphp/pest was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 26 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 8b6607e344b29b282a73fccba1363954bfede68c — the exact code this score is about.
- Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-a15879f6f801.