For a testing framework for PHP applications, the strongest matches are sebastianbergmann/phpunit (PHPUnit is the industry-standard testing framework for the PHP), pestphp/pest (Pest is a comprehensive, industry-standard testing framework for PHP) and codeception/codeception (Codeception is a comprehensive, industry-standard testing framework for PHP). behat/behat and phpspec/phpspec round out the shortlist. Each is ranked by relevance to your query, popularity and recent activity.
We curate open-source GitHub repositories matching “best php testing frameworks”. Results are ranked by relevance to your query — pick filters below to narrow, or refine with AI.
PHPUnit is a unit testing framework and automated testing tool for the PHP ecosystem. It provides a comprehensive suite for writing and running automated tests to verify the functional correctness of PHP code and identify software bugs. The framework supports both unit and end-to-end testing to validate individual code units and complete application workflows. It includes capabilities for automated regression testing and test suite management, allowing for the execution of targeted subsets of tests. The tool provides mechanisms for identifying flaky tests through automatic retries and test r
PHPUnit is the industry-standard testing framework for the PHP ecosystem, providing a comprehensive suite for unit, integration, and functional testing along with built-in mocking, assertion, and code coverage capabilities.
Pest is a testing framework for PHP that provides a comprehensive suite for executing unit, integration, and end-to-end tests. It functions as an automated testing tool that prioritizes developer experience and readability through a concise, expressive syntax for defining test suites. By wrapping an established testing foundation, it maintains compatibility with existing ecosystem tools while offering a specialized interface for writing and organizing automated tests. The framework distinguishes itself through integrated support for parallel test execution, which distributes suites across mul
Pest is a comprehensive, industry-standard testing framework for PHP that natively supports unit, integration, and functional testing with built-in mocking, assertion, and code coverage capabilities.
Codeception is a full-stack testing framework for PHP applications that provides a unified interface for unit, functional, and acceptance testing. It serves as a tool for automating real desktop and mobile browsers via the WebDriver protocol and acts as a client for testing REST and SOAP APIs. The framework is distinguished by its support for Behavior-Driven Development, allowing users to write human-readable test specifications in Gherkin language to align technical tests with business requirements. It implements actor-based action mapping to connect these natural language steps to executabl
Codeception is a comprehensive, industry-standard testing framework for PHP that provides a unified interface for unit, functional, and acceptance testing, fully supporting the requested features including mocking, code coverage, and data-driven testing.
Behat is a behavior-driven development framework and test automation tool for PHP. It functions as a Gherkin test runner that maps natural language feature files to executable PHP methods to verify that software implementation aligns with business requirements. The framework enables the definition of application behavior using a structured, human-readable format based on user stories, supporting localized keywords for non-English speaking stakeholders. It distinguishes itself through a driver-based browser simulation layer for user interface verification and specialized integrations for the S
Behat is a specialized behavior-driven development framework for PHP that focuses on functional and acceptance testing through human-readable Gherkin scenarios, making it a robust tool for verifying business requirements even though it is distinct from traditional unit-testing-focused frameworks.
SpecBDD Framework for PHP
This is a specialized BDD-focused testing framework for PHP that provides robust unit testing and mocking capabilities, though it is designed for specification-driven development rather than general-purpose integration or functional testing.
:heavycheckmark: PHP Test Framework for Freedom, Truth, and Justice
Kahlan is a full-featured PHP testing framework that provides built-in support for unit testing, mocking, and code coverage analysis without requiring external dependencies.
This project is a mocking framework and library designed for creating simulated objects to isolate code and verify interactions during PHPUnit testing. It serves as a toolset for writing and running automated tests in PHP to ensure software correctness. The library replaces real object dependencies with controlled doubles to test specific code paths and simulate complex class behaviors. This enables the verification of logic within individual PHP classes by mocking the inputs and outputs of their collaborators. The framework provides capabilities for runtime object synthesis and interception
This is a specialized mocking library designed to be used as a component within a larger testing framework like PHPUnit, rather than a comprehensive testing framework that provides the full suite of unit, integration, and functional testing capabilities requested.
Prophecy is a PHP mocking framework and test double library used to simulate object dependencies during unit testing. It serves as a behavioral testing tool for creating mocks, stubs, and dummies to isolate code and ensure predictable test results. The framework enables interaction verification by tracking method call counts and arguments to validate that specific interactions occurred. It supports defining specific return values or custom logic for method calls to simulate various execution scenarios. The library provides capabilities for argument matching based on type or value, interactio
This is a specialized mocking and stubbing library designed to be integrated into a broader testing suite rather than a comprehensive, all-in-one testing framework that provides unit, integration, and functional testing capabilities.
Instantiator is a PHP library designed to create class instances without invoking their constructors. It uses the PHP Reflection API to allocate objects in memory and initialize them in a predefined state, bypassing standard constructor logic. The project functions as a data hydration tool and a testing helper. It enables the population of PHP objects from external data sources by mapping values directly to properties, regardless of whether those properties are public, protected, or private. This capability allows for the generation of objects in specific internal states for unit tests withou
This library is a specialized utility for bypassing constructors to instantiate objects, serving as a building block for mocking and testing tools rather than a comprehensive testing framework itself.
Mockery is a PHP framework designed for creating test doubles, stubs, and spies to facilitate isolated unit testing. It serves as a utility for simulating class behavior, intercepting method calls, and validating arguments, allowing developers to replace real dependencies with mock objects to verify that code components interact as intended. The framework distinguishes itself through advanced capabilities for handling complex testing scenarios, such as bypassing constructors, mocking protected methods, and intercepting static calls or internal object instantiations. It provides a fluent inter
This repository is a specialized library for creating test doubles and mocks, which serves as a building block for testing rather than a comprehensive, all-in-one testing framework that handles unit, integration, and functional test execution.
| Repository | Stars | Language | License | Last push |
|---|---|---|---|---|
| sebastianbergmann/phpunit | 20K | PHP | BSD-3-Clause | |
| pestphp/pest | 11.5K | PHP | MIT | |
| codeception/codeception | 4.9K | PHP | MIT | |
| behat/behat | 4K | PHP | MIT | |
| phpspec/phpspec | 1.9K | PHP | NOASSERTION | |
| kahlan/kahlan | 1.1K | PHP | MIT | |
| sebastianbergmann/phpunit-mock-objects | 4.9K | PHP | NOASSERTION | |
| phpspec/prophecy | 8.5K | PHP | MIT | |
| doctrine/instantiator | 11K | PHP | MIT | |
| mockery/mockery | 10.7K | PHP | BSD-3-Clause |