-
Notifications
You must be signed in to change notification settings - Fork 16
/
TestCase.php
73 lines (63 loc) · 1.73 KB
/
TestCase.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<?php
declare(strict_types=1);
namespace Arcanedev\LaravelSettings\Tests;
use Arcanedev\LaravelSettings\Contracts\Manager;
use Arcanedev\LaravelSettings\Middleware\SaveSettings;
use Arcanedev\LaravelSettings\SettingsServiceProvider;
use Illuminate\Contracts\Http\Kernel;
use Orchestra\Testbench\TestCase as BaseTestCase;
/**
* Class TestCase
*
* @author ARCANEDEV <arcanedev.maroc@gmail.com>
*/
abstract class TestCase extends BaseTestCase
{
/* -----------------------------------------------------------------
| Main Methods
| -----------------------------------------------------------------
*/
/**
* Setup the test environment.
*/
protected function setUp(): void
{
parent::setUp();
$this->loadMigrationsFrom(__DIR__ .'/../database/migrations');
}
/**
* Get package providers.
*
* @param \Illuminate\Foundation\Application $app
*
* @return array
*/
protected function getPackageProviders($app): array
{
return [
SettingsServiceProvider::class,
];
}
/**
* Define environment setup.
*
* @param \Illuminate\Foundation\Application $app
*/
protected function getEnvironmentSetUp($app)
{
$app->make(Kernel::class)->pushMiddleware(SaveSettings::class);
}
/* -----------------------------------------------------------------
| Helpers
| -----------------------------------------------------------------
*/
/**
* Get the settings manager instance.
*
* @return \Arcanedev\LaravelSettings\Contracts\Manager
*/
protected function getSettingsManager(): Manager
{
return $this->app->make(Manager::class);
}
}