Passed
Branch master (e30549)
by noitran
04:00
created

TestCase   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 7
dl 0
loc 27
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Noitran\RQL\Tests;
4
5
use Orchestra\Testbench\TestCase as OrchestraTestCase;
6
use Illuminate\Database\Eloquent\Factory as EloquentFactory;
7
8
/**
9
 * Class TestCase
10
 */
11
abstract class TestCase extends OrchestraTestCase
12
{
13
    /**
14
     * Setup the test environment.
15
     */
16
    protected function setUp(): void
17
    {
18
        parent::setUp();
19
20
        $this->loadMigrationsFrom(__DIR__ . '/database/migrations');
21
        $this->registerEloquentFactoriesFrom(__DIR__ . '/database/factories');
22
23
        $this->artisan('db:seed', [
24
            '--class' => PostTestSeeder::class,
25
        ]);
26
    }
27
28
    /**
29
     * Register factories.
30
     *
31
     * @param string $path
32
     *
33
     * @return void
34
     */
35
    protected function registerEloquentFactoriesFrom($path): void
36
    {
37
        $this->app->make(EloquentFactory::class)->load($path);
38
    }
39
}
40