Skip to content

Instantly share code, notes, and snippets.

@IsraelOrtuno
Created January 7, 2016 16:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save IsraelOrtuno/145edcaacd44d63ae5f1 to your computer and use it in GitHub Desktop.
Save IsraelOrtuno/145edcaacd44d63ae5f1 to your computer and use it in GitHub Desktop.
<?php
class TestCase extends Illuminate\Foundation\Testing\TestCase
{
/**
* The base URL to use while testing the application.
*
* @var string
*/
protected $baseUrl = 'http://samples.dev';
/**
* Setting up the test environment.
*/
public function setUp()
{
parent::setUp();
$this->configureDatabase();
}
/**
* Creates the application.
*
* @return \Illuminate\Foundation\Application
*/
public function createApplication()
{
$app = require __DIR__ . '/../bootstrap/app.php';
$app->make(Illuminate\Contracts\Console\Kernel::class)->bootstrap();
return $app;
}
/**
* Configure temporal database.
*/
protected function configureDatabase()
{
$this->app['config']->set('database.default', 'sqlite');
$this->app['config']->set('database.connections.sqlite.database', ':memory:');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment