Skip to content

Commit b0f483a

Browse files
committed
updated test for facade settings registration added into service provider
1 parent e146a7e commit b0f483a

File tree

5 files changed

+8
-5
lines changed

5 files changed

+8
-5
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ $ composer require qcod/laravel-app-settings
2222
```php
2323
'providers' => [
2424
//...
25-
QCod\AppSettings\AppSettingsServiceProvider::class
25+
QCod\AppSettings\AppSettingsServiceProvider::class,
2626
]
2727

2828
'aliases' => [

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
"QCod\\AppSettings\\AppSettingsServiceProvider"
5050
],
5151
"aliases": {
52-
"Setting": "QCod\\AppSettings\\Facade"
52+
"AppSettings": "QCod\\AppSettings\\Facade"
5353
}
5454
}
5555
},

src/AppSettingsServiceProvider.php

+3
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ public function boot()
4242
*/
4343
public function register()
4444
{
45+
// register setting service provider
46+
$this->app->register('QCod\Settings\SettingsServiceProvider');
47+
4548
// bind app settings
4649
$this->app->singleton('app-settings', function ($app) {
4750
return new AppSettings($app->make('QCod\Settings\Setting\SettingStorage'));

tests/AppSettingsTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ public function it_can_call_accessor_on_setting_via_class_handle_method()
303303
*/
304304
public function it_can_access_settings_via_facade()
305305
{
306-
\Setting::set('app_maker', 'apple');
307-
$this->assertEquals('apple', \Setting::get('app_maker'));
306+
\AppSettings::set('app_maker', 'apple');
307+
$this->assertEquals('apple', \AppSettings::get('app_maker'));
308308
}
309309
}

tests/TestCase.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ protected function getPackageProviders($app)
3838
protected function getPackageAliases($app)
3939
{
4040
return [
41-
'Setting' => 'QCod\Settings\Facade'
41+
'AppSettings' => 'QCod\Settings\Facade'
4242
];
4343
}
4444

0 commit comments

Comments
 (0)