mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-07-30 04:23:11 +03:00
Notifications: Fixed issues causing failing tests
- Ensured watch options passed in all meta template usage to fix failing scenarios where watch options did not exist. - Fixed testing issue caused by guest user permission caching.
This commit is contained in:
@ -102,6 +102,7 @@ class WatchTest extends TestCase
|
||||
]);
|
||||
|
||||
$this->assertPermissionError($resp);
|
||||
$guest->unsetRelations();
|
||||
}
|
||||
|
||||
public function test_watch_detail_display_reflects_state()
|
||||
|
@ -55,7 +55,7 @@ class UserRoleProvider
|
||||
*/
|
||||
public function guest(): User
|
||||
{
|
||||
return User::where('system_name', '=', 'public')->firstOrFail();
|
||||
return User::getDefault();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -5,6 +5,7 @@ namespace Tests;
|
||||
use BookStack\Entities\Models\Entity;
|
||||
use BookStack\Settings\SettingService;
|
||||
use BookStack\Uploads\HttpFetcher;
|
||||
use BookStack\Users\Models\User;
|
||||
use GuzzleHttp\Client;
|
||||
use GuzzleHttp\Handler\MockHandler;
|
||||
use GuzzleHttp\HandlerStack;
|
||||
@ -46,6 +47,7 @@ abstract class TestCase extends BaseTestCase
|
||||
$this->permissions = new PermissionsProvider($this->users);
|
||||
$this->files = new FileProvider();
|
||||
|
||||
User::clearDefault();
|
||||
parent::setUp();
|
||||
|
||||
// We can uncomment the below to run tests with failings upon deprecations.
|
||||
|
Reference in New Issue
Block a user