PHPackages                             heybigname/phpspec-testbench - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. heybigname/phpspec-testbench

ActiveLibrary[Testing &amp; Quality](/categories/testing)

heybigname/phpspec-testbench
============================

PHPSpec extension for usage with orchestra/testbench's Laravel fixture

2.0.0(8y ago)014MITPHP

Since Jun 13Pushed 8y ago2 watchersCompare

[ Source](https://github.com/heybigname/phpspec-testbench)[ Packagist](https://packagist.org/packages/heybigname/phpspec-testbench)[ RSS](/packages/heybigname-phpspec-testbench/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (2)Versions (5)Used By (0)

PHPSpec Testbench
=================

[](#phpspec-testbench)

Forked to `heybigname/phpspec-testbench` to incorporate updated dependencies.

[![PXL icon](https://camo.githubusercontent.com/55767c0160080ae730667c934be0ea11482fa2803b921f7df8d8734dfa0baf26/687474703a2f2f7777772e706978656c696e64757374726965732e636f6d2f696d672f6c6f676f2e737667)](https://camo.githubusercontent.com/55767c0160080ae730667c934be0ea11482fa2803b921f7df8d8734dfa0baf26/687474703a2f2f7777772e706978656c696e64757374726965732e636f6d2f696d672f6c6f676f2e737667)

[![SensioLabsInsight](https://camo.githubusercontent.com/dcddef6cc83ad3ba7edf8955799008294c98a8636ef2eaab8aa35be5614058be/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f33346136623566612d373238332d343465652d613033312d6133643133633037306439312f6d696e692e706e67)](https://insight.sensiolabs.com/projects/34a6b5fa-7283-44ee-a031-a3d13c070d91)

Overview
--------

[](#overview)

PHPSpec Testbench is built upon [benconstable/phpspec-laravel](https://github.com/BenConstable/phpspec-laravel) and will bridge the gap between PHPSpec and [orchestral/testbench](https://github.com/orchestral/testbench) by using the Laravel Application fixture as provided by testbench instead of having to need a fully prepared Laravel Application for yourself. With the `phpspec-testbench` extension, you can spec your Laravel Packages easily, whilst keeping all of the functionality that the `phpspec-laravel` extension brings.

Requirements
------------

[](#requirements)

PHPSpec Testbench is built with Laravel 5 in mind and thus depends on the corresponding L5 compatible versions from `phpspec-laravel` and `orchestral-testbench`. **PHPSpec Testbench does not work with Laravel 4**.

Installation
------------

[](#installation)

Simply pull in this package via composer:

`composer require pixelindustries/phpspec-testbench --dev`

Usage
-----

[](#usage)

In your `phpspec.yml` file, simply add the `Pixelindustries\PhpspecTestbench\LaravelExtension` to the `extension` array:

```
extensions:
  - Pixelindustries\PhpspecTestbench\LaravelExtension
```

**Please note that this extension should not be used in *addition* to the `phpspec-laravel` extension, but rather as a replacement.**

After the above configuration, simply write your specs the way you are used to, utilizing `phpspec-laravel`'s functionality in the process.

### Custom application class

[](#custom-application-class)

Should you need to do custom routines for the application bootstrapping, such as making sure your own developed service providers are registered, you can utilize the `app_classname` setting for the `laravel_extension` key in your `phpspec.yml` file:

```
laravel_extension:
  app_classname: Acme\Tests\MyCustomApp
```

This gives you the flexibility to implement your own routines in the `getEnvironmentSetUp()` method as provided by [testbench](http://orchestraplatform.com/docs/latest/components/testbench#overriding-setup-method). For example:

```
