2014-06-28 02:41:44 -05:00
|
|
|
<?php
|
2015-01-01 05:06:42 -06:00
|
|
|
|
|
|
|
use League\FactoryMuffin\Facade as f;
|
|
|
|
|
2014-06-28 02:41:44 -05:00
|
|
|
|
2014-08-10 11:22:42 -05:00
|
|
|
/**
|
|
|
|
* Class TestCase
|
|
|
|
*/
|
2014-11-25 14:04:00 -06:00
|
|
|
class TestCase extends Illuminate\Foundation\Testing\TestCase
|
|
|
|
{
|
2014-07-03 02:16:17 -05:00
|
|
|
/**
|
2015-01-17 03:06:12 -06:00
|
|
|
* @SuppressWarnings(PHPMD.UnusedLocalVariable)
|
|
|
|
*
|
2014-07-03 02:16:17 -05:00
|
|
|
* Creates the application.
|
|
|
|
*
|
|
|
|
* @return \Symfony\Component\HttpKernel\HttpKernelInterface
|
|
|
|
*/
|
|
|
|
public function createApplication()
|
|
|
|
{
|
2014-11-25 14:04:00 -06:00
|
|
|
$unitTesting = true;
|
2015-01-01 05:33:07 -06:00
|
|
|
$testEnvironment = 'testingInMemory';
|
|
|
|
|
2014-11-25 14:04:00 -06:00
|
|
|
|
|
|
|
return require __DIR__ . '/../../bootstrap/start.php';
|
2015-01-01 05:06:42 -06:00
|
|
|
|
2014-08-21 00:21:56 -05:00
|
|
|
}
|
2014-11-18 03:33:38 -06:00
|
|
|
|
2014-11-25 14:04:00 -06:00
|
|
|
public function setUp()
|
|
|
|
{
|
2014-11-18 03:33:38 -06:00
|
|
|
parent::setUp();
|
2015-01-01 05:33:07 -06:00
|
|
|
$this->prepareForTests();
|
|
|
|
|
2014-11-25 14:04:00 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
static public function setupBeforeClass()
|
|
|
|
{
|
2015-01-01 05:06:42 -06:00
|
|
|
f::loadFactories(__DIR__ . '/factories');
|
2014-11-25 14:04:00 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
public function tearDown()
|
|
|
|
{
|
2015-01-01 05:06:42 -06:00
|
|
|
//m::close();
|
2014-11-25 14:04:00 -06:00
|
|
|
}
|
2015-01-01 05:33:07 -06:00
|
|
|
|
|
|
|
/**
|
|
|
|
* 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);
|
|
|
|
}
|
2015-01-01 23:16:49 -06:00
|
|
|
}
|