Version Compatibility

Installation

To install through composer, simply put the following in your composer.json file:

{
"require-dev": {
"orchestra/testbench": "~3.0"
}
}

And then run composer install from the terminal.

Quick Installation

Above installation can also be simplify by using the following command:

composer require --dev "orchestra/testbench=~3.0"

Usage

To use Testbench Component, all you need to do is extend Orchestra\Testbench\TestCase instead of PHPUnit_Framework_TestCase. The fixture app booted by Orchestra\Testbench\TestCase is predefined to follow the base application skeleton of Laravel 5.

<?php
class TestCase extends Orchestra\Testbench\TestCase
{
//
}

Custom Service Providers

To load your package service provider, override the getPackageProviders.

Using Migrations

Testbench include a custom migrations command that support realpath option instead of the basic relative path option, this would make it easier for you to run database migrations during testing by just including the full realpath to your package database/migration folder.

Session not set on request

The error might pop-up when testing routes with Request::old() or old() helper inside the requested view. This is due to Testbench not loading the default global middleware made available with Laravel.

To avoid breaking Backward Compatibility (BC) under 3.1 please add the following code under your setUp or getEnvironmentSetUp method.