PHP Testing

Open-source PHP projects categorized as Testing

Top 23 PHP Testing Projects

  • GitHub repo PHPUnit

    The PHP Unit Testing framework.

    Project mention: Test doubles | dev.to | 2021-03-18

    PHPUnit, the most popular and most used testing framework in PHP, has its own built in support for test doubles.

  • GitHub repo Mockery

    Mockery is a simple yet flexible PHP mock object framework for use in unit testing with PHPUnit, PHPSpec or any other testing framework. Its core goal is to offer a test double framework with a succinct API capable of clearly defining all possible object operations and interactions using a human readable Domain Specific Language (DSL).

    Project mention: Test doubles | dev.to | 2021-03-18

    Mockery is another framework for creating test doubles. It can be used with PHPUnit, phpspec, Behat, or any other testing framework. I find it especially powerful when working with legacy code, due to its support for creating partial mocks or mocking hard dependencies.

  • GitHub repo PHPStan

    PHP Static Analysis Tool - discover bugs in your code without running it!

    Project mention: Automating code quality check using GrumPHP in Magento 2 | dev.to | 2021-04-11
  • GitHub repo Prophecy

    Highly opinionated mocking framework for PHP 5.3+

    Project mention: Test doubles | dev.to | 2021-03-18

    Prophecy is a framework for creating test doubles that was initially built for the requirements of phpspec, but it can be used with any other PHP testing framework. Since PHPUnit 4.5 it bundles Prophecy within PHPUnit itself, but as of PHPUnit 9.x this bundling is deprecated and set to be removed in PHPUnit 10.

  • GitHub repo php-webdriver

    PHP client for Selenium/WebDriver protocol. Previously facebook/php-webdriver

    Project mention: Shellnium: Simple Selnium WebDriver for Bash | dev.to | 2021-02-24

    For example, if you want to use php, you can use facebook-webdriver like this.

  • GitHub repo Codeception

    Full-stack testing PHP framework

  • GitHub repo Behat

    BDD in PHP

    Project mention: 10 Of The Best PHP Testing Frameworks For 2021 | dev.to | 2021-02-17

    Step 3: If you don’t have a Composer, you can easily set up the framework by downloading the latest version of behat.phar.

  • GitHub repo Pest

    Pest is an elegant PHP Testing Framework with a focus on simplicity (by pestphp)

  • GitHub repo Alice

    Expressive fixtures generator (by nelmio)

  • GitHub repo PHPSpec

    SpecBDD Framework for PHP

  • GitHub repo ParaTest

    :computer: Parallel testing for PHPUnit

    Project mention: Looking for a book to help with writing tests | reddit.com/r/PHP | 2021-02-11

    Once you have lots of tests, use https://github.com/paratestphp/paratest with this I can run 3100 tests in about 3 seconds (on a 4core box using 16 threads).

  • GitHub repo php-ddd-example

    🐘🎯 Hexagonal Architecture + DDD + CQRS in PHP using Symfony 5

    Project mention: DDD / Hexagonal Architecture | reddit.com/r/symfony | 2021-02-13

    Have a look at https://symfonycasts.com/screencast/symfonycon2019/hexagonal-architecture-with-symfony (and all resources from Matthias Noback including books, tweets and blogposts). Also check: - https://github.com/CodelyTV/php-ddd-example - https://github.com/msgphp/msgphp - https://minompi.medium.com/symfony-and-hexagonal-architecture-b3c4704e94de- https://blog.elao.com/fr/dev/architecture-hexagonale-symfony/ (needs to be translated from french, but really good one). - https://verraes.net/ (and all resources/tweets/blogposts from Mathias Verraes who has really good knowledge on DDD topics)

  • GitHub repo Infection

    AST based PHP Mutation Testing Framework

    Project mention: news.ycombinator.com | 2021-02-17

    I’ve used the infection PHP library (https://github.com/infection/infection) in an API SDK that I maintain.

    My experiences were very similar to the author’s when I first started using it. Even though my test coverage was near 100%, the mutations introduced revealed that in large part my tests were fallible due to assumptions I’d made when writing them.

    I’ve incorporated mutation testing as the final step in my CI workflow as a test for my tests. It’s a fair bit of work the first time it’s run (especially with larger libraries), but in my opinion vital as a pairing with tests.

  • GitHub repo Atoum

    The modern, simple and intuitive PHP unit testing framework.

    Project mention: 10 Of The Best PHP Testing Frameworks For 2021 | dev.to | 2021-02-17

    Before installation, make sure you have the latest version of PHP installed in your system. You can set up an Atoumframework by either one of the ways.

  • GitHub repo phoronix-test-suite

    The Phoronix Test Suite open-source, cross-platform automated testing/benchmarking software.

    Project mention: Otra duda sobre la fuente de poder | reddit.com/r/Argaming | 2021-03-03
  • GitHub repo VFS Stream

    vfsStream is a stream wrapper for a virtual file system that may be helpful in unit tests to mock the real file system. It can be used with any unit test framework, like PHPUnit or SimpleTest.

  • GitHub repo Kahlan

    :heavy_check_mark: PHP Test Framework for Freedom, Truth, and Justice

  • GitHub repo puphpeteer

    A Puppeteer bridge for PHP, supporting the entire API.

    Project mention: PHP Interact with remote website | reddit.com/r/PHPhelp | 2021-04-12
  • GitHub repo AspectMock

    The most powerful and flexible mocking framework for PHPUnit / Codeception.

  • GitHub repo PHP Censor

    PHP Censor is an open source self-hosted continuous integration server for PHP projects.

  • GitHub repo PHP Architecture Tester

    PHP Architecture Tester - Easy to use architectural testing tool for PHP :heavy_check_mark:

    Project mention: Weekly "ask anything" thread | reddit.com/r/PHP | 2021-03-22

    Might be something for https://github.com/carlosas/phpat.

  • GitHub repo Phake

    PHP Mocking Framework

  • GitHub repo php-mysql-engine

    A MySQL engine written in pure PHP

    Project mention: SleekDB 2.0 - A NoSQL Database made using PHP | reddit.com/r/PHP | 2021-02-01

    A bit like how Vimeo's fake MySQL PHP objects would speed up their tests 2x on native Linux, and 5x in docker with the source under test on macOS.

NOTE: The open source projects on this list are ordered by number of github stars. The number of mentions indicates repo mentiontions in the last 12 Months or since we started tracking (Dec 2020). The latest post mention was on 2021-04-12.

Index

What are some of the best open-source Testing projects in PHP? This list will help you:

Project Stars
1 PHPUnit 17,235
2 Mockery 9,768
3 PHPStan 9,732
4 Prophecy 7,947
5 php-webdriver 4,305
6 Codeception 4,260
7 Behat 3,550
8 Pest 2,317
9 Alice 2,220
10 PHPSpec 1,757
11 ParaTest 1,698
12 php-ddd-example 1,604
13 Infection 1,429
14 Atoum 1,383
15 phoronix-test-suite 1,348
16 VFS Stream 1,306
17 Kahlan 1,068
18 puphpeteer 1,032
19 AspectMock 732
20 PHP Censor 622
21 PHP Architecture Tester 496
22 Phake 456
23 php-mysql-engine 426