Skip to content

orchestral/testbench

Folders and files

NameName
Last commit message
Last commit date

Latest commit

0d53d2f · Jun 19, 2013

History

14 Commits
Jun 9, 2013
Jun 8, 2013
Jun 19, 2013
Jun 11, 2013

Repository files navigation

Laravel Package Unit Testing Helper

Orchestra\Testbench is a simple package that suppose to help you write test cases for your Laravel package especially when there routing involved.

Installation

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

{
	"require-dev": {
		"orchestra/testbench": "2.0.*"
	}
}

Usage

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

<?php

class TestCase extends Orchestra\Testbench\TestCase {}

Custom Service Provider

To load your package service provider override the getPackageProviders.

	protected function getPackageProviders()
	{
		return array('Acme\AcmeServiceProvider');
	}

Custom Aliases

To load your package alias override the getPackageAliases.

	protected function getPackageAliases()
	{
		return array(
			'Acme' => 'Acme\Facade'
		);
	}