Passed
Push — 2.0 ( f5ddb0...24c833 )
by Samuel
02:58 queued 47s
created

TestCase::getEnvironmentSetUp()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 7
nc 1
nop 1
dl 0
loc 12
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace SMartins\Exceptions\Tests;
4
5
use SMartins\Exceptions\JsonHandlerServiceProvider;
6
use Orchestra\Testbench\TestCase as BaseTestCase;
7
8
abstract class TestCase extends BaseTestCase
9
{
10
    /**
11
     * Define environment setup.
12
     *
13
     * @param  \Illuminate\Foundation\Application  $app
14
     * @return void
15
     */
16
    protected function getEnvironmentSetUp($app)
17
    {
18
        $app->singleton(
19
            \Illuminate\Contracts\Debug\ExceptionHandler::class,
20
            \SMartins\Exceptions\Tests\Fixtures\Exceptions\Handler::class
21
        );
22
23
        // Setup default database to use sqlite :memory:
24
        $app['config']->set('database.default', 'exceptions');
25
        $app['config']->set('database.connections.exceptions', [
26
            'driver'   => 'sqlite',
27
            'database' => ':memory:',
28
        ]);
29
    }
30
31
    protected function getPackageProviders($app)
32
    {
33
        return [
34
            JsonHandlerServiceProvider::class,
35
        ];
36
    }
37
}
38