Files
firefly-iii/tests/TestCase.php

66 lines
1.2 KiB
PHP
Raw Normal View History

2015-02-06 04:39:52 +01:00
<?php
2015-04-03 08:37:53 +02:00
use League\FactoryMuffin\Facade as FactoryMuffin;
2015-02-11 07:35:10 +01:00
/**
* Class TestCase
*/
class TestCase extends Illuminate\Foundation\Testing\TestCase
{
2015-02-06 04:39:52 +01:00
2015-02-11 07:35:10 +01:00
/**
* Creates the application.
*
* @return \Illuminate\Foundation\Application
*/
public function createApplication()
{
2015-03-13 08:44:07 +01:00
$app = require __DIR__ . '/../bootstrap/app.php';
2015-02-06 04:39:52 +01:00
2015-02-11 07:35:10 +01:00
$app->make('Illuminate\Contracts\Console\Kernel')->bootstrap();
2015-02-06 04:39:52 +01:00
2015-02-11 07:35:10 +01:00
return $app;
}
2015-02-06 04:39:52 +01:00
2015-04-03 08:37:53 +02:00
/**
* This method is called before the first test of this test class is run.
*
* @since Method available since Release 3.4.0
*/
public static function setUpBeforeClass()
{
2015-04-04 21:52:56 +02:00
parent::setUpBeforeClass();
2015-04-03 08:37:53 +02:00
}
/**
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*/
public function setUp()
{
parent::setUp();
Artisan::call('migrate');
FactoryMuffin::loadFactories(__DIR__ . '/factories');
}
2015-03-31 19:21:49 +02:00
/**
* @param string $class
*
* @return mixed
*/
public function mock($class)
{
$mock = Mockery::mock($class);
$this->app->instance($class, $mock);
return $mock;
}
2015-02-06 04:39:52 +01:00
}