Prep for unit testing

This commit is contained in:
snipe
2013-11-25 08:09:14 -05:00
parent acfda8dc82
commit a8d01550dc
2 changed files with 37 additions and 0 deletions
+14
View File
@@ -0,0 +1,14 @@
<?php
return array(
'default' => 'sqlite',
'connections' => array(
'sqlite' => array(
'driver' => 'sqlite',
'database' => ':memory:',
'prefix' => ''
),
)
);
+23
View File
@@ -2,6 +2,18 @@
class TestCase extends Illuminate\Foundation\Testing\TestCase {
/**
* Default preparation for each test
*
*/
public function setUp()
{
parent::setUp(); // Don't forget this!
$this->prepareForTests();
}
/**
* Creates the application.
*
@@ -16,4 +28,15 @@ class TestCase extends Illuminate\Foundation\Testing\TestCase {
return require __DIR__.'/../../bootstrap/start.php';
}
/**
* Migrates the database and set the mailer to 'pretend'.
* This will cause the tests to run quickly.
*
*/
private function prepareForTests()
{
Artisan::call('migrate');
Mail::pretend(true);
}
}