Files
firefly-iii/app/tests/TestCase.php

56 lines
1.0 KiB
PHP
Raw Normal View History

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