Skip to content

Commit

Permalink
Merge branch '2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
crynobone committed Aug 1, 2013
2 parents 6c2a230 + d4c36da commit 6d0a316
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 7 deletions.
13 changes: 13 additions & 0 deletions src/Orchestra/Testbench/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,22 @@ public function createApplication()

$providers = array_merge($this->getApplicationProviders(), $this->getPackageProviders());
$app->getProviderRepository()->load($app, $providers);

$this->getEnvironmentSetUp($app);

$app->boot();

return $app;
}

/**
* Define environment setup.
*
* @param Illuminate\Foundation\Application $app
* @return void
*/
protected function getEnvironmentSetUp($app)
{
// Define your environment setup.
}
}
23 changes: 16 additions & 7 deletions tests/DatabaseFixtureTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,28 @@ public function setUp()
{
parent::setUp();

$this->app['config']->set('database.default', 'testbench');
$this->app['config']->set('database.connections.testbench', array(
'driver' => 'sqlite',
'database' => ':memory:',
'prefix' => '',
));

$this->app['artisan']->call('migrate', array(
'--path' => '../../tests/migrations',
'--database' => 'testbench',
));
}

/**
* Define environment setup.
*
* @param Illuminate\Foundation\Application $app
* @return void
*/
protected function getEnvironmentSetUp($app)
{
$app['config']->set('database.default', 'testbench');
$app['config']->set('database.connections.testbench', array(
'driver' => 'sqlite',
'database' => ':memory:',
'prefix' => '',
));
}

/**
* Test running migration.
*
Expand Down

0 comments on commit 6d0a316

Please sign in to comment.