mirror of
https://github.com/bs-community/blessing-skin-server.git
synced 2024-12-21 06:19:38 +08:00
Tweak service container
This commit is contained in:
parent
28a4144ed1
commit
625cc08b81
@ -21,7 +21,8 @@ class AppServiceProvider extends ServiceProvider
|
|||||||
public function register()
|
public function register()
|
||||||
{
|
{
|
||||||
$this->app->singleton('cipher', 'App\Services\Cipher\\'.config('secure.cipher'));
|
$this->app->singleton('cipher', 'App\Services\Cipher\\'.config('secure.cipher'));
|
||||||
$this->app->singleton('options', \App\Services\Option::class);
|
$this->app->singleton(\App\Services\Option::class);
|
||||||
|
$this->app->alias(\App\Services\Option::class, 'options');
|
||||||
$this->app->singleton('parsedown', \Parsedown::class);
|
$this->app->singleton('parsedown', \Parsedown::class);
|
||||||
$this->app->singleton('webpack', \App\Services\Webpack::class);
|
$this->app->singleton('webpack', \App\Services\Webpack::class);
|
||||||
}
|
}
|
||||||
|
@ -36,6 +36,7 @@ class OptionTest extends TestCase
|
|||||||
$mock->shouldReceive('getRequire')->with($path)->once()->andReturn(['k' => 'v']);
|
$mock->shouldReceive('getRequire')->with($path)->once()->andReturn(['k' => 'v']);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
app()->forgetInstance(Option::class);
|
||||||
$options = resolve(Option::class);
|
$options = resolve(Option::class);
|
||||||
$this->assertEquals('v', $options->get('k'));
|
$this->assertEquals('v', $options->get('k'));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user