Passed
Pull Request — master (#9)
by Бабичев
03:04
created

TestCase::setUp()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 4
nc 1
nop 0
dl 0
loc 6
c 0
b 0
f 0
cc 1
rs 10
1
<?php
2
3
namespace Bavix\Wallet\Test;
4
5
use Bavix\Wallet\WalletServiceProvider;
6
use Illuminate\Foundation\Application;
7
use Orchestra\Testbench\TestCase as OrchestraTestCase;
8
9
class TestCase extends OrchestraTestCase
10
{
11
12
    /**
13
     * @return void
14
     */
15
    public function setUp(): void
16
    {
17
        parent::setUp();
18
        $this->withFactories(__DIR__ . '/factories');
19
        $this->loadMigrationsFrom(__DIR__ . '/migrations');
20
        $this->loadMigrationsFrom(\dirname(__DIR__) . '/database/migrations');
21
    }
22
23
    /**
24
     * @param Application $app
25
     * @return array
26
     */
27
    protected function getPackageProviders($app): array
0 ignored issues
show
Unused Code introduced by
The parameter $app is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

27
    protected function getPackageProviders(/** @scrutinizer ignore-unused */ $app): array

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
28
    {
29
        return [WalletServiceProvider::class];
30
    }
31
32
    /**
33
     * Define environment setup.
34
     *
35
     * @param  Application $app
36
     * @return void
37
     */
38
    protected function getEnvironmentSetUp($app): void
39
    {
40
        $app['config']->set('database.default', 'testbench');
41
        $app['config']->set('database.connections.testbench', [
42
            'driver' => 'sqlite',
43
            'database' => ':memory:',
44
            'prefix' => '',
45
        ]);
46
    }
47
48
}
49