mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2024-11-27 19:31:01 -06:00
48 lines
971 B
PHP
48 lines
971 B
PHP
<?php
|
|
use League\FactoryMuffin\Facade as f;
|
|
|
|
/**
|
|
* Class TestCase
|
|
*/
|
|
class TestCase extends Illuminate\Foundation\Testing\TestCase
|
|
{
|
|
|
|
/**
|
|
* Creates the application.
|
|
*
|
|
* @return \Symfony\Component\HttpKernel\HttpKernelInterface
|
|
* @SuppressWarnings(PHPMD.UnusedLocalVariable)
|
|
*/
|
|
public function createApplication()
|
|
{
|
|
/** @noinspection PhpUnusedLocalVariableInspection */
|
|
$unitTesting = true;
|
|
|
|
/** @noinspection PhpUnusedLocalVariableInspection */
|
|
$testEnvironment = 'testing';
|
|
|
|
return require __DIR__ . '/../../bootstrap/start.php';
|
|
}
|
|
|
|
public function setUp()
|
|
{
|
|
parent::setUp();
|
|
f::loadFactories(__DIR__ . '/factories');
|
|
}
|
|
|
|
/**
|
|
* @param $class
|
|
*
|
|
* @return \Mockery\MockInterface
|
|
*/
|
|
public function mock($class)
|
|
{
|
|
$mock = Mockery::mock($class);
|
|
|
|
$this->app->instance($class, $mock);
|
|
|
|
return $mock;
|
|
}
|
|
|
|
}
|