MediaTestCase::getEnvironmentSetUp()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 20
Code Lines 13

Duplication

Lines 0
Ratio 0 %

Importance

Changes 3
Bugs 0 Features 0
Metric Value
dl 0
loc 20
rs 9.4286
c 3
b 0
f 0
cc 1
eloc 13
nc 1
nop 1
1
<?php namespace Modules\Media\Tests;
2
3
use Collective\Html\FormFacade;
4
use Collective\Html\HtmlFacade;
5
use Collective\Html\HtmlServiceProvider;
6
use Illuminate\Support\Facades\Validator;
7
use Illuminate\Translation\TranslationServiceProvider;
8
use Intervention\Image\ImageServiceProvider;
9
use Maatwebsite\Sidebar\SidebarServiceProvider;
10
use Mcamara\LaravelLocalization\Facades\LaravelLocalization;
11
use Mcamara\LaravelLocalization\LaravelLocalizationServiceProvider;
12
use Modules\Core\Providers\CoreServiceProvider;
13
use Modules\Media\Providers\MediaServiceProvider;
14
use Orchestra\Testbench\TestCase;
15
use Pingpong\Modules\ModulesServiceProvider;
16
use Pingpong\Modules\Providers\BootstrapServiceProvider;
17
18
abstract class MediaTestCase extends TestCase
19
{
20
    protected function getPackageProviders($app)
21
    {
22
        return [
23
            TranslationServiceProvider::class,
24
            ModulesServiceProvider::class,
25
            BootstrapServiceProvider::class,
26
            CoreServiceProvider::class,
27
            MediaServiceProvider::class,
28
            ImageServiceProvider::class,
29
            LaravelLocalizationServiceProvider::class,
30
            HtmlServiceProvider::class,
31
            SidebarServiceProvider::class,
32
        ];
33
    }
34
35
    protected function getPackageAliases($app)
36
    {
37
        return [
38
            'LaravelLocalization' => LaravelLocalization::class,
39
            'Validator' => Validator::class,
40
            'Form' => FormFacade::class,
41
            'Html' => HtmlFacade::class,
42
        ];
43
    }
44
45
    protected function getEnvironmentSetUp($app)
46
    {
47
        $conf = [
48
            'smallThumb' => [
49
                'fit' => [
50
                    'width' => 50,
51
                    'height' => 50,
52
                    'callback' => function ($constraint) {
53
                        $constraint->upsize();
54
                    },
55
                ],
56
            ],
57
        ];
58
        $app['path.base'] = __DIR__ . '/..';
59
        $app['config']->set('asgard.media.thumbnails', $conf);
60
        $app['config']->set('modules', [
61
            'namespace' => 'Modules',
62
        ]);
63
        $app['config']->set('modules.paths.modules', realpath(__DIR__ . '/../Modules'));
64
    }
65
}
66