Skip to content

Commit

Permalink
Add Example to getEnvironmentSetUp().
Browse files Browse the repository at this point in the history
Signed-off-by: crynobone <crynobone@gmail.com>
  • Loading branch information
crynobone committed Jan 8, 2015
1 parent bb5c612 commit 5de9e18
Showing 1 changed file with 36 additions and 24 deletions.
60 changes: 36 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,46 +52,58 @@ class TestCase extends Orchestra\Testbench\TestCase {}
To load your package service provider, override the `getPackageProviders`.

```php

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

### Custom Aliases

To load your package alias, override the `getPackageAliases`.

```php

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

### Overriding setUp() method

Since `Orchestral\TestCase` overrides Laravel's `TestCase`, if you need your own `setUp()` implementation, do not forget to call `parent::setUp()`:
Since `Orchestral\Testbench\TestCase` replace Laravel's `TestCase`, if you need your own `setUp()` implementation, do not forget to call `parent::setUp()`:

```php
public function setUp()
{
parent::setUp();
public function setUp()
{
parent::setUp();

// Your code here
}
// Your code here
}
```

If you need to add something early in the application bootstrapping process, you could use the `getEnvironmentSetUp()` method:

```php
/**
* Define environment setup.
*
* @param Illuminate\Foundation\Application $app
* @return void
*/
protected function getEnvironmentSetUp($app)
{
//
}
```

## Testing Route Filters

By default, route filters are disabled by Laravel because, ideally, you should test the filter separately. In order to overwrite this default, add the following code:

```php

$this->app['router']->enableFilters();
```

Expand All @@ -112,11 +124,11 @@ Due to the requirement with Laravel Framework 4.1, we need to maintain a modifie
```json
{
"repositories": [
{
"type": "vcs",
"url": "git://github.com/orchestral/phpseclib.git"
}
],
{
"type": "vcs",
"url": "git://github.com/orchestral/phpseclib.git"
}
],
}
```

Expand Down

0 comments on commit 5de9e18

Please sign in to comment.