]> BookStack Code Mirror - bookstack/blobdiff - tests/TestCase.php
Added Swedish locale to config
[bookstack] / tests / TestCase.php
index b008080d9c3ed92cad3976e6c554628facbb48a3..81bd93ec4de41fdea805824cf22980a5ea785531 100644 (file)
@@ -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