mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2024-11-30 04:33:54 -06:00
55 lines
994 B
PHP
55 lines
994 B
PHP
<?php
|
|
use Mockery as m;
|
|
|
|
/**
|
|
* Class TestCase
|
|
*/
|
|
class TestCase extends Illuminate\Foundation\Testing\TestCase
|
|
{
|
|
/**
|
|
* Creates the application.
|
|
*
|
|
* @return \Symfony\Component\HttpKernel\HttpKernelInterface
|
|
*/
|
|
public function createApplication()
|
|
{
|
|
$unitTesting = true;
|
|
$testEnvironment = 'testing';
|
|
|
|
return require __DIR__ . '/../../bootstrap/start.php';
|
|
}
|
|
|
|
public function setUp()
|
|
{
|
|
parent::setUp();
|
|
Artisan::call('migrate');
|
|
$this->seed();
|
|
|
|
|
|
//$this->
|
|
}
|
|
|
|
/**
|
|
* @param $class
|
|
*
|
|
* @return m\MockInterface
|
|
*/
|
|
public function mock($class)
|
|
{
|
|
$mock = Mockery::mock($class);
|
|
|
|
$this->app->instance($class, $mock);
|
|
|
|
return $mock;
|
|
}
|
|
|
|
static public function setupBeforeClass()
|
|
{
|
|
League\FactoryMuffin\Facade::loadFactories(__DIR__ . '/factories');
|
|
}
|
|
|
|
public function tearDown()
|
|
{
|
|
m::close();
|
|
}
|
|
} |