Created
January 7, 2016 16:51
-
-
Save IsraelOrtuno/145edcaacd44d63ae5f1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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