FunctionalTestCase::getEnvironmentSetUp()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 14
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 8
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 14
rs 10
1
<?php
2
3
namespace JosephNC\Translation\Tests;
4
5
use JosephNC\Translation\TranslationServiceProvider;
6
use Orchestra\Testbench\TestCase;
7
8
class FunctionalTestCase extends TestCase
9
{
10
    /**
11
     * Set up the test environment.
12
     */
13
    public function setUp()
14
    {
15
        parent::setUp();
16
17
        $this->artisan('migrate', [
18
            '--database' => 'testbench',
19
            '--realpath' => realpath(__DIR__.'/../src/Migrations'),
20
        ]);
21
    }
22
23
    /**
24
     * Define environment setup.
25
     *
26
     * @param \Illuminate\Foundation\Application $app
27
     *
28
     * @return void
29
     */
30
    protected function getEnvironmentSetUp($app)
31
    {
32
        $app['config']->set('database.default', 'testbench');
33
        $app['config']->set('database.connections.testbench', [
34
            'driver'   => 'sqlite',
35
            'database' => ':memory:',
36
        ]);
37
38
        $app['config']->set('translation.locales', [
39
            'en' => 'English',
40
            'fr' => 'French',
41
        ]);
42
43
        $app['config']->set('translation.key', 123456);
44
    }
45
46
    /**
47
     * Returns the package providers.
48
     *
49
     * @return array
50
     */
51
    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

51
    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...
52
    {
53
        return [TranslationServiceProvider::class];
54
    }
55
56
    /**
57
     * Returns the package aliases.
58
     *
59
     * @return array
60
     */
61
    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

61
    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...
62
    {
63
        return ['Translation' => \JosephNC\Translation\Facades\Translation::class];
64
    }
65
}
66