mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2024-11-23 09:26:29 -06:00
56 lines
1.0 KiB
PHP
56 lines
1.0 KiB
PHP
<?php
|
|
|
|
use League\FactoryMuffin\Facade as f;
|
|
|
|
|
|
/**
|
|
* Class TestCase
|
|
*/
|
|
class TestCase extends Illuminate\Foundation\Testing\TestCase
|
|
{
|
|
/**
|
|
* @SuppressWarnings(PHPMD.UnusedLocalVariable)
|
|
*
|
|
* Creates the application.
|
|
*
|
|
* @return \Symfony\Component\HttpKernel\HttpKernelInterface
|
|
*/
|
|
public function createApplication()
|
|
{
|
|
$unitTesting = true;
|
|
$testEnvironment = 'testingInMemory';
|
|
|
|
|
|
return require __DIR__ . '/../../bootstrap/start.php';
|
|
|
|
}
|
|
|
|
public function setUp()
|
|
{
|
|
parent::setUp();
|
|
$this->prepareForTests();
|
|
|
|
}
|
|
|
|
static public function setupBeforeClass()
|
|
{
|
|
f::loadFactories(__DIR__ . '/factories');
|
|
}
|
|
|
|
public function tearDown()
|
|
{
|
|
//m::close();
|
|
}
|
|
|
|
/**
|
|
* 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);
|
|
}
|
|
}
|