Passed
Branch master (1e50c2)
by noitran
01:58 queued 33s
created

TestCase   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 8
dl 0
loc 31
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 9 1
A registerEloquentFactoriesFrom() 0 3 1
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
    use Reflections;
0 ignored issues
show
Bug introduced by
The type Noitran\RQL\Tests\Reflections was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
14
15
    /**
16
     * Setup the test environment.
17
     */
18
    protected function setUp(): void
19
    {
20
        parent::setUp();
21
22
        $this->loadMigrationsFrom(__DIR__ . '/database/migrations');
23
        $this->registerEloquentFactoriesFrom(__DIR__ . '/database/factories');
24
25
        $this->artisan('db:seed', [
26
            '--class' => PostTestSeeder::class,
27
        ]);
28
29
        // $this->app->bind(UserRepository::class, UserRepositoryEloquent::class);
30
    }
31
32
    /**
33
     * Register factories.
34
     *
35
     * @param string $path
36
     *
37
     * @return void
38
     */
39
    protected function registerEloquentFactoriesFrom($path): void
40
    {
41
        $this->app->make(EloquentFactory::class)->load($path);
42
    }
43
}
44