Orchestra\Testbench is a simple package that suppose to help you write test cases for your Laravel package especially when there routing involved.
To install through composer, simply put the following in your composer.json
file:
{
"require-dev": {
"orchestra/testbench": "2.0.*"
}
}
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 {}
To load your package service provider override the getPackageProviders
.
protected function getPackageProviders()
{
return array('Acme\AcmeServiceProvider');
}
To load your package alias override the getPackageAliases
.
protected function getPackageAliases()
{
return array(
'Acme' => 'Acme\Facade'
);
}