Test Setup Failed
Push — master ( 698635...8c1479 )
by Jeremy
05:28 queued 12s
created

TestCase::getEnvironmentSetUp()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 9
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
namespace jeremykenedy\LaravelRoles\Test;
4
5
use jeremykenedy\LaravelRoles\RolesFacade;
6
use jeremykenedy\LaravelRoles\RolesServiceProvider;
7
use Orchestra\Testbench\TestCase as OrchestraTestCase;
8
use Seedster\Handlers\SeedHandler;
9
10
class TestCase extends OrchestraTestCase
11
{
12
    /**
13
     * Get package providers.
14
     *
15
     * @param  \Illuminate\Foundation\Application  $app
16
     *
17
     * @return array<int, class-string>
0 ignored issues
show
Documentation Bug introduced by
The doc comment array<int, class-string> at position 4 could not be parsed: Unknown type name 'class-string' at position 4 in array<int, class-string>.
Loading history...
18
     */
19
    protected function getPackageProviders($app)
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

19
    protected function getPackageProviders(/** @scrutinizer ignore-unused */ $app)

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...
20
    {
21
        return [RolesServiceProvider::class];
22
    }
23
24
    /**
25
     * Get package aliases.
26
     *
27
     * @param  \Illuminate\Foundation\Application  $app
28
     *
29
     * @return array<string, class-string>
0 ignored issues
show
Documentation Bug introduced by
The doc comment array<string, class-string> at position 4 could not be parsed: Unknown type name 'class-string' at position 4 in array<string, class-string>.
Loading history...
30
     */
31
    protected function getPackageAliases($app)
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

31
    protected function getPackageAliases(/** @scrutinizer ignore-unused */ $app)

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...
32
    {
33
        return [
34
            'laravelroles' => RolesFacade::class,
35
        ];
36
    }
37
38
    /**
39
     * Define environment setup.
40
     *
41
     * @param  \Illuminate\Foundation\Application  $app
42
     *
43
     * @return void
44
     */
45
    public function getEnvironmentSetUp($app)
46
    {
47
        $app->singleton('seed.handler', function ($app) {
48
            return new SeedHandler($app, collect());
49
        });
50
51
        include_once __DIR__ . '/../src/Database/TestMigrations/create_users_table.php';
52
53
        (new \jeremykenedy\LaravelRoles\Database\TestMigrations\CreateUsersTable())->up();
54
    }
55
}
56