Home

Awesome

Laravel TestBench

Laravel TestBench was created by, and is maintained by Graham Campbell, and provides some testing functionality for Laravel. It utilises PHPUnit, Mockery, Orchestral Testbench, and the Laravel Testbench Core packages. Feel free to check out the change log, releases, security policy, license, code of conduct, and contribution guidelines.

Banner

<p align="center"> <a href="https://github.com/GrahamCampbell/Laravel-TestBench/actions?query=workflow%3ATests"><img src="https://img.shields.io/github/actions/workflow/status/GrahamCampbell/Laravel-TestBench/tests.yml?label=Tests&style=flat-square" alt="Build Status"></img></a> <a href="https://github.styleci.io/repos/15239209"><img src="https://github.styleci.io/repos/15239209/shield" alt="StyleCI Status"></img></a> <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-brightgreen?style=flat-square" alt="Software License"></img></a> <a href="https://packagist.org/packages/graham-campbell/testbench"><img src="https://img.shields.io/packagist/dt/graham-campbell/testbench?style=flat-square" alt="Packagist Downloads"></img></a> <a href="https://github.com/GrahamCampbell/Laravel-TestBench/releases"><img src="https://img.shields.io/github/release/GrahamCampbell/Laravel-TestBench?style=flat-square" alt="Latest Version"></img></a> </p>

Installation

This version requires PHP 7.4-8.3 and supports PHPUnit 9-10 and Laravel 8-11. PHPUnit 11 is intentionally not supported at this time due to PHPUnit's volatility across minor releases. We would highly recommend sticking with PHPUnit 10 at this time.

TestBenchL5.5L5.6L5.7L5.8L6L7L8L9L10L11
4.0:white_check_mark::x::x::x::x::x::x::x::x::x:
5.7:x::x::white_check_mark::white_check_mark::white_check_mark::white_check_mark::white_check_mark::white_check_mark::x::x:
6.0:x::x::x::x::x::x::white_check_mark::white_check_mark::white_check_mark::white_check_mark:
TestBenchPHPUnit 6PHPUnit 7PHPUnit 8PHPUnit 9PHPUnit 10PHPUnit 11
4.0:white_check_mark::x::x::x::x::x:
5.7:white_check_mark::white_check_mark::white_check_mark::white_check_mark::x::x:
6.0:x::x::x::white_check_mark::white_check_mark::x:

To get the latest version, simply require the project using Composer:

$ composer require "graham-campbell/testbench:^6.1" --dev

Once installed, you can extend or implement the classes in this package, or packages required by this package. The AbstractTestCase class would be a good place to start. There are no service providers to register.

Configuration

Laravel TestBench requires no configuration. Just follow the simple install instructions and go!

Usage

You may see an example of implementation in pretty much all of my Laravel packages.

Security

If you discover a security vulnerability within this package, please send an email to security@tidelift.com. All security vulnerabilities will be promptly addressed. You may view our full security policy here.

License

Laravel TestBench is licensed under The MIT License (MIT).

For Enterprise

Available as part of the Tidelift Subscription

The maintainers of graham-campbell/testbench and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. Learn more.