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

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
pull/51704/head
Côme Chilliet 2025-03-18 15:53:47 +07:00
parent 07422477f5
commit 304112b0ad
No known key found for this signature in database
GPG Key ID: A3E2F658B28C760A
2 changed files with 3 additions and 1 deletions

@ -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]);

@ -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 |