]> BookStack Code Mirror - bookstack/blobdiff - tests/Settings/RegenerateReferencesTest.php
respective book and chapter structure added.
[bookstack] / tests / Settings / RegenerateReferencesTest.php
index 0f3122074d7f452b647ddcbb2cfbef8a1b9de536..0511f2624cfdc53b52c82e2a6b16591cb2eaf22e 100644 (file)
@@ -2,7 +2,7 @@
 
 namespace Tests\Settings;
 
-use BookStack\Actions\ActivityType;
+use BookStack\Activity\ActivityType;
 use BookStack\References\ReferenceStore;
 use Tests\TestCase;
 
@@ -21,7 +21,7 @@ class RegenerateReferencesTest extends TestCase
     public function test_action_runs_reference_regen()
     {
         $this->mock(ReferenceStore::class)
-            ->shouldReceive('updateForAllPages')
+            ->shouldReceive('updateForAll')
             ->once();
 
         $resp = $this->asAdmin()->post('/settings/maintenance/regenerate-references');
@@ -32,11 +32,11 @@ class RegenerateReferencesTest extends TestCase
 
     public function test_settings_manage_permission_required()
     {
-        $editor = $this->getEditor();
+        $editor = $this->users->editor();
         $resp = $this->actingAs($editor)->post('/settings/maintenance/regenerate-references');
         $this->assertPermissionError($resp);
 
-        $this->giveUserPermissions($editor, ['settings-manage']);
+        $this->permissions->grantUserRolePermissions($editor, ['settings-manage']);
 
         $resp = $this->actingAs($editor)->post('/settings/maintenance/regenerate-references');
         $this->assertNotPermissionError($resp);
@@ -45,7 +45,7 @@ class RegenerateReferencesTest extends TestCase
     public function test_action_failed_shown_as_error_notification()
     {
         $this->mock(ReferenceStore::class)
-            ->shouldReceive('updateForAllPages')
+            ->shouldReceive('updateForAll')
             ->andThrow(\Exception::class, 'A badger stopped the task');
 
         $resp = $this->asAdmin()->post('/settings/maintenance/regenerate-references');