@@ -91,11 +91,7 @@ class FeatureContext implements Context, SnippetAcceptingContext {
91
91
private array $ cookieJars ;
92
92
93
93
protected string $ localServerUrl ;
94
-
95
- protected string $ localRemoteServerUrl ;
96
-
97
94
protected string $ remoteServerUrl ;
98
-
99
95
protected string $ baseUrl ;
100
96
101
97
protected string $ currentServer ;
@@ -184,7 +180,6 @@ public function getAttendeeId(string $type, string $id, string $room, ?string $u
184
180
public function __construct () {
185
181
$ this ->cookieJars = [];
186
182
$ this ->localServerUrl = getenv ('TEST_SERVER_URL ' );
187
- $ this ->localRemoteServerUrl = getenv ('TEST_LOCAL_REMOTE_URL ' );
188
183
$ this ->remoteServerUrl = getenv ('TEST_REMOTE_URL ' );
189
184
190
185
foreach (['LOCAL ' , 'REMOTE ' ] as $ server ) {
@@ -563,7 +558,6 @@ private function assertRooms(array $rooms, TableNode $formData, bool $shouldOrde
563
558
if (isset ($ expectedRoom ['lastMessageActorId ' ])) {
564
559
$ data ['lastMessageActorId ' ] = $ room ['lastMessage ' ] ? $ room ['lastMessage ' ]['actorId ' ] : '' ;
565
560
$ data ['lastMessageActorId ' ] = str_replace (rtrim ($ this ->localServerUrl , '/ ' ), '{$LOCAL_URL} ' , $ data ['lastMessageActorId ' ]);
566
- $ data ['lastMessageActorId ' ] = str_replace (rtrim ($ this ->localRemoteServerUrl , '/ ' ), '{$LOCAL_REMOTE_URL} ' , $ data ['lastMessageActorId ' ]);
567
561
$ data ['lastMessageActorId ' ] = str_replace (rtrim ($ this ->remoteServerUrl , '/ ' ), '{$REMOTE_URL} ' , $ data ['lastMessageActorId ' ]);
568
562
}
569
563
if (isset ($ expectedRoom ['lastReadMessage ' ])) {
@@ -650,13 +644,7 @@ public function userAcceptsDeclinesRemoteInvite(string $user, string $acceptsDec
650
644
$ verb = $ acceptsDeclines === 'accepts ' ? 'POST ' : 'DELETE ' ;
651
645
652
646
$ this ->setCurrentUser ($ user );
653
- if ($ this ->currentServer === 'LOCAL ' && $ server === 'LOCAL ' ) {
654
- $ this ->baseUrl = $ this ->localRemoteServerUrl ;
655
- $ this ->sendRequest ($ verb , '/apps/spreed/api/ ' . $ apiVersion . '/federation/invitation/ ' . $ inviteId );
656
- $ this ->baseUrl = $ this ->localServerUrl ;
657
- } else {
658
- $ this ->sendRequest ($ verb , '/apps/spreed/api/ ' . $ apiVersion . '/federation/invitation/ ' . $ inviteId );
659
- }
647
+ $ this ->sendRequest ($ verb , '/apps/spreed/api/ ' . $ apiVersion . '/federation/invitation/ ' . $ inviteId );
660
648
$ this ->assertStatusCode ($ this ->response , $ status );
661
649
$ response = $ this ->getDataFromResponse ($ this ->response );
662
650
@@ -719,11 +707,9 @@ private function assertInvites($invites, TableNode $formData) {
719
707
protected function translateRemoteServer (string $ server ): string {
720
708
$ server = str_replace ([
721
709
'http://localhost:8080 ' ,
722
- 'http://localhost:8180 ' ,
723
710
'http://localhost:8280 ' ,
724
711
], [
725
712
'LOCAL ' ,
726
- 'LOCAL_REMOTE ' ,
727
713
'REMOTE ' ,
728
714
], $ server );
729
715
if (str_contains ($ server , 'http:// ' )) {
@@ -905,9 +891,6 @@ protected function assertAttendeeList(string $identifier, ?TableNode $formData,
905
891
if (isset ($ attendee ['actorId ' ]) && str_ends_with ($ attendee ['actorId ' ], '@{$LOCAL_URL} ' )) {
906
892
$ attendee ['actorId ' ] = str_replace ('{$LOCAL_URL} ' , rtrim ($ this ->localServerUrl , '/ ' ), $ attendee ['actorId ' ]);
907
893
}
908
- if (isset ($ attendee ['actorId ' ]) && str_ends_with ($ attendee ['actorId ' ], '@{$LOCAL_REMOTE_URL} ' )) {
909
- $ attendee ['actorId ' ] = str_replace ('{$LOCAL_REMOTE_URL} ' , rtrim ($ this ->localRemoteServerUrl , '/ ' ), $ attendee ['actorId ' ]);
910
- }
911
894
if (isset ($ attendee ['actorId ' ]) && str_ends_with ($ attendee ['actorId ' ], '@{$REMOTE_URL} ' )) {
912
895
$ attendee ['actorId ' ] = str_replace ('{$REMOTE_URL} ' , rtrim ($ this ->remoteServerUrl , '/ ' ), $ attendee ['actorId ' ]);
913
896
}
@@ -926,9 +909,6 @@ protected function assertAttendeeList(string $identifier, ?TableNode $formData,
926
909
if (isset ($ attendee ['sessionIds ' ]) && str_contains ($ attendee ['sessionIds ' ], '@{$LOCAL_URL} ' )) {
927
910
$ attendee ['sessionIds ' ] = str_replace ('{$LOCAL_URL} ' , rtrim ($ this ->localServerUrl , '/ ' ), $ attendee ['sessionIds ' ]);
928
911
}
929
- if (isset ($ attendee ['sessionIds ' ]) && str_contains ($ attendee ['sessionIds ' ], '@{$LOCAL_REMOTE_URL} ' )) {
930
- $ attendee ['sessionIds ' ] = str_replace ('{$LOCAL_REMOTE_URL} ' , rtrim ($ this ->localRemoteServerUrl , '/ ' ), $ attendee ['sessionIds ' ]);
931
- }
932
912
if (isset ($ attendee ['sessionIds ' ]) && str_contains ($ attendee ['sessionIds ' ], '@{$REMOTE_URL} ' )) {
933
913
$ attendee ['sessionIds ' ] = str_replace ('{$REMOTE_URL} ' , rtrim ($ this ->remoteServerUrl , '/ ' ), $ attendee ['sessionIds ' ]);
934
914
}
@@ -1997,8 +1977,6 @@ public function userAddAttendeeToRoom(string $user, string $newType, string $new
1997
1977
if ($ newType === 'federated_user ' ) {
1998
1978
if (!str_contains ($ newId , '@ ' )) {
1999
1979
$ newId .= '@ ' . $ this ->remoteServerUrl ;
2000
- } elseif (str_ends_with ($ newId , '@LOCAL_REMOTE ' )) {
2001
- $ newId = str_replace ('LOCAL_REMOTE ' , $ this ->localRemoteServerUrl , $ newId );
2002
1980
} else {
2003
1981
$ newId = str_replace ('REMOTE ' , $ this ->remoteServerUrl , $ newId );
2004
1982
}
@@ -2067,11 +2045,8 @@ public function userSetsPermissionsForInRoomTo(string $user, string $participant
2067
2045
} elseif (strpos ($ participant , 'guest ' ) === 0 ) {
2068
2046
$ sessionId = self ::$ userToSessionId [$ participant ];
2069
2047
$ attendeeId = $ this ->getAttendeeId ('guests ' , sha1 ($ sessionId ), $ identifier , $ statusCode === 200 ? $ user : null );
2070
- } elseif (str_ends_with ($ participant , '@{$LOCAL_REMOTE_URL} ' ) ||
2071
- str_ends_with ($ participant , '@{$REMOTE_URL} ' )) {
2072
- $ participant = str_replace ('{$LOCAL_REMOTE_URL} ' , rtrim ($ this ->localRemoteServerUrl , '/ ' ), $ participant );
2048
+ } elseif (str_ends_with ($ participant , '@{$REMOTE_URL} ' )) {
2073
2049
$ participant = str_replace ('{$REMOTE_URL} ' , rtrim ($ this ->remoteServerUrl , '/ ' ), $ participant );
2074
-
2075
2050
$ attendeeId = $ this ->getAttendeeId ('federated_users ' , $ participant , $ identifier , $ statusCode === 200 ? $ user : null );
2076
2051
} else {
2077
2052
$ attendeeId = $ this ->getAttendeeId ('users ' , $ participant , $ identifier , $ statusCode === 200 ? $ user : null );
@@ -2325,7 +2300,6 @@ public function userSendsMessageToRoom(string $user, string $sendingMode, string
2325
2300
$ message = substr ($ message , 1 , -1 );
2326
2301
$ message = str_replace ('\n ' , "\n" , $ message );
2327
2302
$ message = str_replace ('{$LOCAL_URL} ' , $ this ->localServerUrl , $ message );
2328
- $ message = str_replace ('{$LOCAL_REMOTE_URL} ' , $ this ->localRemoteServerUrl , $ message );
2329
2303
$ message = str_replace ('{$REMOTE_URL} ' , $ this ->remoteServerUrl , $ message );
2330
2304
if (str_contains ($ message , '@"TEAM_ID( ' )) {
2331
2305
$ result = preg_match ('/TEAM_ID\(([^)]+)\)/ ' , $ message , $ matches );
@@ -2743,9 +2717,6 @@ protected function preparePollExpectedData(array $expected): array {
2743
2717
if (str_ends_with ($ expected ['actorId ' ], '@{$LOCAL_URL} ' )) {
2744
2718
$ expected ['actorId ' ] = str_replace ('{$LOCAL_URL} ' , rtrim ($ this ->localServerUrl , '/ ' ), $ expected ['actorId ' ]);
2745
2719
}
2746
- if (str_ends_with ($ expected ['actorId ' ], '@{$LOCAL_REMOTE_URL} ' )) {
2747
- $ expected ['actorId ' ] = str_replace ('{$LOCAL_REMOTE_URL} ' , rtrim ($ this ->localRemoteServerUrl , '/ ' ), $ expected ['actorId ' ]);
2748
- }
2749
2720
if (str_ends_with ($ expected ['actorId ' ], '@{$REMOTE_URL} ' )) {
2750
2721
$ expected ['actorId ' ] = str_replace ('{$REMOTE_URL} ' , rtrim ($ this ->remoteServerUrl , '/ ' ), $ expected ['actorId ' ]);
2751
2722
}
@@ -2754,9 +2725,6 @@ protected function preparePollExpectedData(array $expected): array {
2754
2725
if (str_contains ($ expected ['details ' ], '@{$LOCAL_URL} ' )) {
2755
2726
$ expected ['details ' ] = str_replace ('{$LOCAL_URL} ' , rtrim ($ this ->localServerUrl , '/ ' ), $ expected ['details ' ]);
2756
2727
}
2757
- if (str_contains ($ expected ['details ' ], '@{$LOCAL_REMOTE_URL} ' )) {
2758
- $ expected ['details ' ] = str_replace ('{$LOCAL_REMOTE_URL} ' , rtrim ($ this ->localRemoteServerUrl , '/ ' ), $ expected ['details ' ]);
2759
- }
2760
2728
if (str_contains ($ expected ['details ' ], '@{$REMOTE_URL} ' )) {
2761
2729
$ expected ['details ' ] = str_replace ('{$REMOTE_URL} ' , rtrim ($ this ->remoteServerUrl , '/ ' ), $ expected ['details ' ]);
2762
2730
}
@@ -3211,19 +3179,13 @@ protected function compareDataResponse(?TableNode $formData = null) {
3211
3179
if (str_ends_with ($ expected [$ i ]['actorId ' ], '@{$LOCAL_URL} ' )) {
3212
3180
$ expected [$ i ]['actorId ' ] = str_replace ('{$LOCAL_URL} ' , rtrim ($ this ->localServerUrl , '/ ' ), $ expected [$ i ]['actorId ' ]);
3213
3181
}
3214
- if (str_ends_with ($ expected [$ i ]['actorId ' ], '@{$LOCAL_REMOTE_URL} ' )) {
3215
- $ expected [$ i ]['actorId ' ] = str_replace ('{$LOCAL_REMOTE_URL} ' , rtrim ($ this ->localRemoteServerUrl , '/ ' ), $ expected [$ i ]['actorId ' ]);
3216
- }
3217
3182
if (str_ends_with ($ expected [$ i ]['actorId ' ], '@{$REMOTE_URL} ' )) {
3218
3183
$ expected [$ i ]['actorId ' ] = str_replace ('{$REMOTE_URL} ' , rtrim ($ this ->remoteServerUrl , '/ ' ), $ expected [$ i ]['actorId ' ]);
3219
3184
}
3220
3185
3221
3186
if (str_contains ($ expected [$ i ]['messageParameters ' ], '{$LOCAL_URL} ' )) {
3222
3187
$ expected [$ i ]['messageParameters ' ] = str_replace ('{$LOCAL_URL} ' , str_replace ('/ ' , '\/ ' , rtrim ($ this ->localServerUrl , '/ ' )), $ expected [$ i ]['messageParameters ' ]);
3223
3188
}
3224
- if (str_contains ($ expected [$ i ]['messageParameters ' ], '{$LOCAL_REMOTE_URL} ' )) {
3225
- $ expected [$ i ]['messageParameters ' ] = str_replace ('{$LOCAL_REMOTE_URL} ' , str_replace ('/ ' , '\/ ' , rtrim ($ this ->localRemoteServerUrl , '/ ' )), $ expected [$ i ]['messageParameters ' ]);
3226
- }
3227
3189
if (str_contains ($ expected [$ i ]['messageParameters ' ], '{$REMOTE_URL} ' )) {
3228
3190
$ expected [$ i ]['messageParameters ' ] = str_replace ('{$REMOTE_URL} ' , str_replace ('/ ' , '\/ ' , rtrim ($ this ->remoteServerUrl , '/ ' )), $ expected [$ i ]['messageParameters ' ]);
3229
3191
}
@@ -3232,9 +3194,6 @@ protected function compareDataResponse(?TableNode $formData = null) {
3232
3194
if (str_ends_with ($ expected [$ i ]['lastEditActorId ' ], '@{$LOCAL_URL} ' )) {
3233
3195
$ expected [$ i ]['lastEditActorId ' ] = str_replace ('{$LOCAL_URL} ' , rtrim ($ this ->localServerUrl , '/ ' ), $ expected [$ i ]['lastEditActorId ' ]);
3234
3196
}
3235
- if (str_ends_with ($ expected [$ i ]['lastEditActorId ' ], '@{$LOCAL_REMOTE_URL} ' )) {
3236
- $ expected [$ i ]['lastEditActorId ' ] = str_replace ('{$LOCAL_REMOTE_URL} ' , rtrim ($ this ->localRemoteServerUrl , '/ ' ), $ expected [$ i ]['lastEditActorId ' ]);
3237
- }
3238
3197
if (str_ends_with ($ expected [$ i ]['lastEditActorId ' ], '@{$REMOTE_URL} ' )) {
3239
3198
$ expected [$ i ]['lastEditActorId ' ] = str_replace ('{$REMOTE_URL} ' , rtrim ($ this ->remoteServerUrl , '/ ' ), $ expected [$ i ]['lastEditActorId ' ]);
3240
3199
}
@@ -3510,18 +3469,12 @@ public function userGetsTheFollowingCandidateMentionsInRoomFor($user, $identifie
3510
3469
if (str_ends_with ($ row ['id ' ], '@{$LOCAL_URL} ' )) {
3511
3470
$ row ['id ' ] = str_replace ('{$LOCAL_URL} ' , rtrim ($ this ->localServerUrl , '/ ' ), $ row ['id ' ]);
3512
3471
}
3513
- if (str_ends_with ($ row ['id ' ], '@{$LOCAL_REMOTE_URL} ' )) {
3514
- $ row ['id ' ] = str_replace ('{$LOCAL_REMOTE_URL} ' , rtrim ($ this ->localRemoteServerUrl , '/ ' ), $ row ['id ' ]);
3515
- }
3516
3472
if (str_ends_with ($ row ['id ' ], '@{$REMOTE_URL} ' )) {
3517
3473
$ row ['id ' ] = str_replace ('{$REMOTE_URL} ' , rtrim ($ this ->remoteServerUrl , '/ ' ), $ row ['id ' ]);
3518
3474
}
3519
3475
if (str_ends_with ($ row ['mentionId ' ], '@{$BASE_URL} ' )) {
3520
3476
$ row ['mentionId ' ] = str_replace ('{$BASE_URL} ' , rtrim ($ this ->localServerUrl , '/ ' ), $ row ['mentionId ' ]);
3521
3477
}
3522
- if (str_ends_with ($ row ['mentionId ' ], '@{$LOCAL_REMOTE_URL} ' )) {
3523
- $ row ['mentionId ' ] = str_replace ('{$LOCAL_REMOTE_URL} ' , rtrim ($ this ->localRemoteServerUrl , '/ ' ), $ row ['mentionId ' ]);
3524
- }
3525
3478
if (str_ends_with ($ row ['mentionId ' ], '@{$REMOTE_URL} ' )) {
3526
3479
$ row ['mentionId ' ] = str_replace ('{$REMOTE_URL} ' , rtrim ($ this ->remoteServerUrl , '/ ' ), $ row ['mentionId ' ]);
3527
3480
}
@@ -4006,7 +3959,6 @@ private function assertNotifications($notifications, TableNode $formData) {
4006
3959
$ messageText = self ::$ messageIdToText [$ message ] ?? 'UNKNOWN_MESSAGE ' ;
4007
3960
4008
3961
$ messageText = str_replace ($ this ->localServerUrl , '{$LOCAL_URL} ' , $ messageText );
4009
- $ messageText = str_replace ($ this ->localRemoteServerUrl , '{$LOCAL_REMOTE_URL} ' , $ messageText );
4010
3962
$ messageText = str_replace ($ this ->remoteServerUrl , '{$REMOTE_URL} ' , $ messageText );
4011
3963
4012
3964
$ data ['object_id ' ] = self ::$ tokenToIdentifier [$ roomToken ] . '/ ' . $ messageText ;
@@ -4583,7 +4535,6 @@ private function assertReactionList(?TableNode $formData): void {
4583
4535
$ reaction ['actorId ' ] = ($ reaction ['actorType ' ] === 'guests ' ) ? self ::$ sessionIdToUser [$ reaction ['actorId ' ]] : (string )$ reaction ['actorId ' ];
4584
4536
if ($ reaction ['actorType ' ] === 'federated_users ' ) {
4585
4537
$ reaction ['actorId ' ] = str_replace (rtrim ($ this ->localServerUrl , '/ ' ), '{$LOCAL_URL} ' , $ reaction ['actorId ' ]);
4586
- $ reaction ['actorId ' ] = str_replace (rtrim ($ this ->localRemoteServerUrl , '/ ' ), '{$LOCAL_REMOTE_URL} ' , $ reaction ['actorId ' ]);
4587
4538
$ reaction ['actorId ' ] = str_replace (rtrim ($ this ->remoteServerUrl , '/ ' ), '{$REMOTE_URL} ' , $ reaction ['actorId ' ]);
4588
4539
}
4589
4540
return $ reaction ;
0 commit comments