1
0
mirror of https://github.com/flarum/core.git synced 2025-08-10 10:24:46 +02:00

Use latest version of settings package

This allows us to get rid of hacks for configuring settings and config
This commit is contained in:
Alexander Skvortsov
2021-05-03 01:35:46 -04:00
parent ad92d11cf9
commit d12d52918b
7 changed files with 14 additions and 69 deletions

View File

@@ -12,12 +12,10 @@ namespace Flarum\Tests\integration\extenders;
use Flarum\Extend;
use Flarum\Testing\integration\RetrievesAuthorizedUsers;
use Flarum\Testing\integration\TestCase;
use Flarum\Testing\integration\UsesSettings;
class SettingsTest extends TestCase
{
use RetrievesAuthorizedUsers;
use UsesSettings;
/**
* @inheritDoc
@@ -29,12 +27,11 @@ class SettingsTest extends TestCase
$this->prepareDatabase([
'users' => [
$this->normalUser()
],
'settings' => [
['key' => 'custom-prefix.custom_setting', 'value' => 'customValue'],
['key' => 'custom-prefix.custom_setting2', 'value' => 'customValue']
]
]);
$this->setting('custom-prefix.custom_setting', 'customValue');
$this->setting('custom-prefix.custom_setting2', 'customValue');
}
/**
@@ -42,8 +39,6 @@ class SettingsTest extends TestCase
*/
public function custom_setting_isnt_serialized_by_default()
{
$this->purgeSettingsCache();
$response = $this->send(
$this->request('GET', '/api', [
'authenticatedAs' => 1,
@@ -65,8 +60,6 @@ class SettingsTest extends TestCase
->serializeToForum('customPrefix.customSetting', 'custom-prefix.custom_setting')
);
$this->purgeSettingsCache();
$response = $this->send(
$this->request('GET', '/api', [
'authenticatedAs' => 1,
@@ -91,8 +84,6 @@ class SettingsTest extends TestCase
})
);
$this->purgeSettingsCache();
$response = $this->send(
$this->request('GET', '/api', [
'authenticatedAs' => 1,
@@ -115,8 +106,6 @@ class SettingsTest extends TestCase
->serializeToForum('customPrefix.customSetting2', 'custom-prefix.custom_setting2', CustomInvokableClass::class)
);
$this->purgeSettingsCache();
$response = $this->send(
$this->request('GET', '/api', [
'authenticatedAs' => 1,
@@ -139,8 +128,6 @@ class SettingsTest extends TestCase
->serializeToForum('customPrefix.noCustomSetting', 'custom-prefix.no_custom_setting', null, 'customDefault')
);
$this->purgeSettingsCache();
$response = $this->send(
$this->request('GET', '/api', [
'authenticatedAs' => 1,
@@ -165,8 +152,6 @@ class SettingsTest extends TestCase
}, 'customDefault')
);
$this->purgeSettingsCache();
$response = $this->send(
$this->request('GET', '/api', [
'authenticatedAs' => 1,