Skip to content
Prev Previous commit
fix(tests): Sort activities by id to get the last one
Signed-off-by: Côme Chilliet <[email protected]>
  • Loading branch information
come-nc committed Mar 27, 2025
commit 304112b0ad9963648313057134fce45dc98b0e33
2 changes: 2 additions & 0 deletions build/integration/features/bootstrap/Activity.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ public function lastActivityIs(TableNode $activity): void {
$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]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 |

Expand Down
Loading