fix(tests): Sort activities by id to get the last one

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
Côme Chilliet
2025-03-18 15:53:47 +01:00
committed by Côme Chilliet
parent c9938e54a6
commit da9b6e376d
2 changed files with 3 additions and 1 deletions

View File

@@ -22,6 +22,8 @@ trait Activity {
$this->theHTTPStatusCodeShouldBe('200');
$data = json_decode($this->response->getBody()->getContents(), true);
$activities = $data['ocs']['data'];
/* Sort by id */
uasort($activities, fn ($a, $b) => $a['activity_id'] <=> $b['activity_id']);
$lastActivity = array_pop($activities);
foreach ($activity->getRowsHash() as $key => $value) {
Assert::assertEquals($value, $lastActivity[$key]);

View File

@@ -10,7 +10,7 @@ Feature: sharing
And Logging in using web as "user0"
And Sending a "POST" to "/apps/activity/settings" with requesttoken
| public_links_notification | 1 |
| public_links_upload_email | 1 |
| public_links_upload_notification | 1 |
| notify_setting_batchtime | 0 |
| activity_digest | 0 |