X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/c8b123bfac012940b64061514058feae7bcf1e5c..refs/pull/3698/head:/tests/Auth/GroupSyncServiceTest.php diff --git a/tests/Auth/GroupSyncServiceTest.php b/tests/Auth/GroupSyncServiceTest.php index 74d2c7e2a..2fad53b26 100644 --- a/tests/Auth/GroupSyncServiceTest.php +++ b/tests/Auth/GroupSyncServiceTest.php @@ -54,4 +54,16 @@ class GroupSyncServiceTest extends TestCase $user = User::query()->find($user->id); $this->assertTrue($user->hasRole($role->id)); } + + public function test_external_auth_id_matches_ignoring_case() + { + $user = $this->getViewer(); + $role = Role::factory()->create(['display_name' => 'ABC123', 'external_auth_id' => 'WaRRioRs']); + $this->assertFalse($user->hasRole($role->id)); + + (new GroupSyncService())->syncUserWithFoundGroups($user, ['wArriors', 'penguiNs'], false); + + $user = User::query()->find($user->id); + $this->assertTrue($user->hasRole($role->id)); + } }