]> BookStack Code Mirror - bookstack/blobdiff - tests/Auth/GroupSyncServiceTest.php
Added language list favourites sorting, updated styles
[bookstack] / tests / Auth / GroupSyncServiceTest.php
index 74d2c7e2ab119709b2eafdd7c522c9fc457c23c8..2fad53b261943fc2fb6b8544ae6ab53170700a52 100644 (file)
@@ -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));
+    }
 }