Test Failed
Push — master ( 3a2408...8f3679 )
by Nur
03:38
created

TestCase::getEnvironmentSetUp()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 9
rs 10
cc 1
nc 1
nop 1
1
<?php
2
3
namespace Turahe\Counters\Tests;
4
5
use Illuminate\Database\Schema\Blueprint;
6
use Mockery;
7
8
class TestCase extends \Orchestra\Testbench\TestCase
9
{
10
    public function setUp(): void
11
    {
12
        parent::setUp();
13
14
        $this->loadMigrationsFrom(__DIR__.'/../database/migrations');
15
        $this->setUpDatabase();
16
    }
17
18
19
    /**
20
     * {@inheritdoc}
21
     */
22
    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

22
    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...
23
    {
24
        return [\Turahe\Counters\CountersServiceProvider::class];
25
    }
26
27
    /**
28
     * @param \Illuminate\Foundation\Application $app
29
     */
30
    protected function getEnvironmentSetUp($app)
31
    {
32
        $app['config']->set('database.default', 'sqlite');
33
        $app['config']->set('database.connections.sqlite', [
34
            'driver' => 'sqlite',
35
            'database' => ':memory:',
36
            'prefix' => '',
37
        ]);
38
        $app['config']->set('app.key', 'base64:MFOsOH9RomiI2LRdgP4hIeoQJ5nyBhdABdH77UY2zi8=');
39
    }
40
41
    protected function setUpDatabase()
42
    {
43
        $this->app['db']->connection()->getSchemaBuilder()->create('posts', function (Blueprint $table) {
44
            $table->increments('id');
45
            $table->string('name');
46
            $table->timestamps();
47
        });
48
49
    }
50
51
}