2017-25 © Pedro Peláez
 

library phpspec-testbench

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

image

heybigname/phpspec-testbench

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

  • Wednesday, May 2, 2018
  • by ShawnMcCool
  • Repository
  • 3 Watchers
  • 0 Stars
  • 2 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

PHPSpec Testbench

Forked to heybigname/phpspec-testbench to incorporate updated dependencies., (*1)

PXL icon, (*2)

SensioLabsInsight, (*3)

Overview

PHPSpec Testbench is built upon benconstable/phpspec-laravel and will bridge the gap between PHPSpec and 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., (*4)

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., (*5)

Installation

Simply pull in this package via composer:, (*6)

composer require pixelindustries/phpspec-testbench --dev, (*7)

Usage

In your phpspec.yml file, simply add the Pixelindustries\PhpspecTestbench\LaravelExtension to the extension array:, (*8)

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., (*9)

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

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:, (*11)

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. For example:, (*12)

<?php

namespace Acme\Tests;

use Pixelindustries\PhpspecTestbench\App as TestApp;

class MyCustomApp extends TestApp
{
  protected function getEnvironmentSetUp($app)
  {
      // Custom bootstrapping
  }
}

Please note that your custom class must extend the Pixelindustries\PhpspecTestbench\App class., (*13)

Thanks

Thanks to @BenConstable for his great work with phpspec-laravel, to @crynobone for his fantastic work with testbench, and of course a big thank you to of the other contributors and to everyone who's reported issues and bugs with these projects., (*14)

The Versions

02/05 2018

dev-master

9999999-dev

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

  Sources   Download

MIT

The Requires

 

by Max van der Stam

02/05 2018

2.0.0

2.0.0.0

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

  Sources   Download

MIT

The Requires

 

by Max van der Stam

13/06 2015

1.0.1

1.0.1.0

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

  Sources   Download

MIT

The Requires

 

by Max van der Stam

13/06 2015

dev-develop

dev-develop

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

  Sources   Download

MIT

The Requires

 

by Max van der Stam

13/06 2015

1.0.0

1.0.0.0

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

  Sources   Download

MIT

The Requires

 

by Max van der Stam