X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/5fee7c4db1a4043a102b46bf023e7bcdae1bbd78..refs/pull/635/head:/tests/TestCase.php diff --git a/tests/TestCase.php b/tests/TestCase.php index b008080d9..81bd93ec4 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -4,6 +4,7 @@ use BookStack\Book; use BookStack\Chapter; use BookStack\Repos\EntityRepo; use BookStack\Role; +use BookStack\Services\SettingService; use Illuminate\Foundation\Testing\DatabaseTransactions; use Illuminate\Foundation\Testing\TestCase as BaseTestCase; @@ -88,4 +89,16 @@ abstract class TestCase extends BaseTestCase $draftPage = $entityRepo->getDraftPage($book); return $entityRepo->publishPageDraft($draftPage, $input); } + + /** + * Quickly sets an array of settings. + * @param $settingsArray + */ + protected function setSettings($settingsArray) + { + $settings = app(SettingService::class); + foreach ($settingsArray as $key => $value) { + $settings->put($key, $value); + } + } } \ No newline at end of file