aboutsummaryrefslogtreecommitdiff
path: root/tests/jsonapi/UsersIndexTest.php
diff options
context:
space:
mode:
authorPhilipp Schüttlöffel <schuettloeffel@zqs.uni-hannover.de>2024-11-26 09:30:35 +0000
committerJan-Hendrik Willms <tleilax+studip@gmail.com>2024-11-26 09:30:35 +0000
commit7abf792f02366b517c243b963cbc3768e64bfe54 (patch)
treeac2531edfa183a2aa8cd828b7a6246ddba5ad7fd /tests/jsonapi/UsersIndexTest.php
parentba8bea5599feb46d6ef487977539368bc24e5945 (diff)
Resolve "VA automatisch löschen wenn sie keine Mitglieder mehr hat"
Closes #4289 Merge request studip/studip!3144
Diffstat (limited to 'tests/jsonapi/UsersIndexTest.php')
-rw-r--r--tests/jsonapi/UsersIndexTest.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/jsonapi/UsersIndexTest.php b/tests/jsonapi/UsersIndexTest.php
index adffee6..6c79cae 100644
--- a/tests/jsonapi/UsersIndexTest.php
+++ b/tests/jsonapi/UsersIndexTest.php
@@ -28,7 +28,9 @@ class UsersIndexTest extends \Codeception\Test\Unit
$response = $this->getUsers($credentials);
$this->tester->assertTrue($response->isSuccessfulDocument([200]));
- $numberOfAllUsers = \User::countBySQL();
+ $vis_query = get_vis_query(context: 'search');
+ $condition = "LEFT JOIN user_visibility ON (user_visibility.user_id = auth_user_md5.user_id) WHERE {$vis_query}";
+ $numberOfAllUsers = \User::countBySQL($condition);
$this->tester->assertSame($numberOfAllUsers, count($response->document()->primaryResources()));
$this->assertValidResourceObject($response, 'users');