Providing some testing functionality for Laravel

Overview

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

Build Status StyleCI Status Software License Packagist Downloads Latest Version

Installation

Laravel TestBench requires PHP 7.1-8.1, and supports PHPUnit 6-10. This particular version supports Laravel 5.5-9.

TestBench L5.1 L5.2 L5.3 L5.5 L5.5 L5.6 L5.7 L5.8 L6 L7 L8 L9
3.4
4.0
5.7
TestBench PHPUnit 4.8 PHPUnit 5 PHPUnit 6 PHPUnit 7 PHPUnit 8 PHPUnit 9 PHPUnit 10
3.4
4.0
5.7

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

$ composer require "graham-campbell/testbench:^5.7" --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 [email protected]. 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.

You might also like...
Phone number functionality for Laravel

Laravel Phone Adds phone number functionality to Laravel and Lumen based on the PHP port of Google's libphonenumber API by giggsey. Table of Contents

Livewire component that brings Spotlight/Alfred-like functionality to your Laravel application.
Livewire component that brings Spotlight/Alfred-like functionality to your Laravel application.

About LivewireUI Spotlight LivewireUI Spotlight is a Livewire component that provides Spotlight/Alfred-like functionality to your Laravel application.

Useful blade components and functionality for most Laravel projects.

laravel-base Note: Package is still in early stages of development, so functionality is subject to change. LaravelBase is a package I've created to pr

Added Laravel functionality to Enlightn Security Checker.
Added Laravel functionality to Enlightn Security Checker.

Added Laravel functionality to Enlightn Security Checker. Adds a command to check for, and optionally emails you, vulnerabilities when they affect you.

An opinionated support package for Laravel, that provides flexible and reusable helper methods and traits for commonly used functionality.

Support An opinionated support package for Laravel, that provides flexible and reusable helper methods and traits for commonly used functionality. Ins

This project demonstrates the power of soketi's WebSocket functionality in Laravel.

Laravel + soketi = 3 This project demonstrates the power of soketi's WebSocket functionality in Laravel. Installing the project The server requires:

Livewire component that brings Spotlight/Alfred-like functionality to your Laravel application.
Livewire component that brings Spotlight/Alfred-like functionality to your Laravel application.

About Wire Elements Spotlight Wire Elements Spotlight is a Livewire component that provides Spotlight/Alfred-like functionality to your Laravel applic

Adds phone number functionality to Laravel based on the PHP port of Google's libphonenumber API by giggsey.

Laravel Phone Adds phone number functionality to Laravel based on the PHP port of Google's libphonenumber API by giggsey. Table of Contents Demo Insta

Added Laravel functionality to Enlightn Security Checker
Added Laravel functionality to Enlightn Security Checker

Added Laravel functionality to Enlightn Security Checker. Adds a command to check for, and optionally emails you, vulnerabilities when they affect you.

Comments
  • Laravel 5.5 Orchestra Testbench Issue

    Laravel 5.5 Orchestra Testbench Issue

    When requiring this package in a Laravel package which only supports version 5.5 it still installs an older version of orchestra/testbench.

    I've provided a failed job from Travis: https://travis-ci.org/vinkla/laravel-algolia/jobs/271252437

    If I specify the exact version of orchestra/testbench in my package it works fine. Though, it shouldn't be necessary right?

    opened by vinkla 10
  • Impossible to inject Config

    Impossible to inject Config

    Hello and thank you for this awesome package.

    I don't know if it is an issue or it's me but when I test my ServiceProvider with the method assertIsInjectabl($name) and in the register method, I do:

    $this->app->singleton('excel-importer.importer', function (Container $app) {
        $config = $app->config->get('excel-importer'); // return null :'( but $app->config is OK
        return new Importer($config);
    });
    

    It throws this exception:

    The class 'Me\ExcelImporter\Importer' couldn't be automatically injected. Unresolvable dependency resolving [Parameter #0 [ <required> array $config ]] in class Me\ExcelImporter\Importer
    Failed asserting that false is true.
    

    Boot method of my service provider:

    $source = realpath(__DIR__ . '/../config/excel-importer.php'); // Path is OK
    $this->publishes([$source => config_path('excel-importer.php')]);
    $this->mergeConfigFrom($source, 'excel-importer');
    

    Many thanks

    opened by ptondereau 7
  • Allow PHPUnit 7.0

    Allow PHPUnit 7.0

    Added support for PHPUnit 7.0 which will be released in two weeks.

    https://twitter.com/s_bergmann/status/954245050392866816

    https://github.com/orchestral/testbench-core/pull/7 https://github.com/GrahamCampbell/Laravel-TestBench-Core/pull/4

    opened by vinkla 2
  • BC break in v5.6 (remove app from getServiceProviderClass definition)

    BC break in v5.6 (remove app from getServiceProviderClass definition)

    Hey

    This is essentially a duplicate of https://github.com/GrahamCampbell/Laravel-TestBench-Core/issues/12 as the same change was made in both packages

    Essentially, we can't use the new v5.6 release as we have an implementation of getServiceProviderClass that has the $app parameter. We support a wide range of PHP versions, so have to be compatible with multiple versions of testbench & testbench-core. If we remove the $app parameter then our code isn't compatible with earlier versions of the library but if we keep it then we're not compatible with the latest version

    Is there a way we can support v5.6 with a single AbstractTestCase? If not, is it possible to revert this change?

    Thanks!

    opened by imjoehaines 0
Releases(v5.7.0)
Owner
Graham Campbell
OSS Maintainer | Laravel Core | StyleCI
Graham Campbell
Laravel Manager provides some manager functionality for Laravel

Laravel Manager Laravel Manager was created by, and is maintained by Graham Campbell, and provides some manager functionality for Laravel. Feel free t

Graham Campbell 371 Jul 11, 2022
A package that uses blade templates to control how markdown is converted to HTML inside Laravel, as well as providing support for markdown files to Laravel views.

Install Install via composer. $ composer require olliecodes/laravel-etched-blade Once installed you'll want to publish the config. $ php artisan vendo

Ollie Codes 19 Jul 5, 2021
Laravel Countries is a bundle for Laravel, providing Almost ISO 3166_2, 3166_3, currency, Capital and more for all countries.

Laravel Countries Laravel Countries is a bundle for Laravel, providing Almost ISO 3166_2, 3166_3, currency, Capital and more for all countries. Please

Christoph Kempen 695 Dec 30, 2022
A Laravel package providing a list of the countries, states, cities, currencies and timezones

A Laravel package to provide a list of the countries, cities, timezones, currencies and phone numbers formatting/validation helpers. The package can b

Najm Njeim 492 Dec 24, 2022
A simple drop-in solution for providing UUID support for the IDs of your Eloquent models.

Introduction A simple drop-in solution for providing UUID support for the IDs of your Eloquent models. Both v1 and v4 IDs are supported out of the box

GoldSpec Digital 501 Jan 4, 2023
This package extends Laravel's FormBuilder to include some (soon all) HTML5 elements

HTML5 Forms for Laravel This package extends Laravel's FormBuilder to include some (soon all) HTML5 elements. How to Install Install the braunson/lara

Braunson Yager 89 Jun 17, 2022
A Laravel package that adds a simple image functionality to any Laravel model

Laraimage A Laravel package that adds a simple image functionality to any Laravel model Introduction Laraimage served four use cases when using images

Hussein Feras 52 Jul 17, 2022
Need some filters? This package is based on the Repository Design Pattern to let you create specific queries easily.

DevMakerLab/Laravel-Filters Need some filters? This package is based on the Repository Design Pattern to let you create specific queries easily. Insta

DevMakerLab 19 Feb 20, 2022
This project is based on the aggregation of jobs from some technology companies.

FIND-JOBS-ALERT ?? ?? ?? This project is based on the aggregation of jobs from some technology companies. Check below, some companies avaliable in pro

Wellisson Ribeiro 2 Dec 1, 2021
Rami's presskit() with some extra conveniences.

presskittie() presskittie() is presskit() by Rami Ismail, but with some conveniences: run and develop it locally with docker deploy it to Github Pages

Juan Uys 14 Oct 31, 2022