@@ -1314,6 +1314,113 @@ public function testRevokeInvitation()
13141314 $ this ->assertSame ($ response ->toArray (), $ expected );
13151315 }
13161316
1317+ public function testResendInvitation ()
1318+ {
1319+ $ invitationId = "invitation_01E4ZCR3C56J083X43JQXF3JK5 " ;
1320+ $ path = "user_management/invitations/ {$ invitationId }/resend " ;
1321+
1322+ $ result = $ this ->invitationResponseFixture ();
1323+
1324+ $ this ->mockRequest (
1325+ Client::METHOD_POST ,
1326+ $ path ,
1327+ null ,
1328+ null ,
1329+ true ,
1330+ $ result
1331+ );
1332+
1333+ $ response = $ this ->userManagement ->resendInvitation ($ invitationId );
1334+
1335+ $ expected = $ this ->invitationFixture ();
1336+
1337+ $ this ->assertSame ($ response ->toArray (), $ expected );
1338+ }
1339+
1340+ public function testResendInvitation404 ()
1341+ {
1342+ $ invitationId = "invitation_01E4ZCR3C56J083X43JQXF3JK5 " ;
1343+ $ path = "user_management/invitations/ {$ invitationId }/resend " ;
1344+
1345+ $ this ->expectException (Exception \NotFoundException::class);
1346+
1347+ $ this ->mockRequest (
1348+ Client::METHOD_POST ,
1349+ $ path ,
1350+ null ,
1351+ null ,
1352+ true ,
1353+ null ,
1354+ null ,
1355+ 404
1356+ );
1357+
1358+ $ this ->userManagement ->resendInvitation ($ invitationId );
1359+ }
1360+
1361+ public function testResendInvitationExpired ()
1362+ {
1363+ $ invitationId = "invitation_01E4ZCR3C56J083X43JQXF3JK5 " ;
1364+ $ path = "user_management/invitations/ {$ invitationId }/resend " ;
1365+
1366+ $ this ->expectException (Exception \BadRequestException::class);
1367+
1368+ $ this ->mockRequest (
1369+ Client::METHOD_POST ,
1370+ $ path ,
1371+ null ,
1372+ null ,
1373+ true ,
1374+ null ,
1375+ null ,
1376+ 400
1377+ );
1378+
1379+ $ this ->userManagement ->resendInvitation ($ invitationId );
1380+ }
1381+
1382+ public function testResendInvitationRevoked ()
1383+ {
1384+ $ invitationId = "invitation_01E4ZCR3C56J083X43JQXF3JK5 " ;
1385+ $ path = "user_management/invitations/ {$ invitationId }/resend " ;
1386+
1387+ $ this ->expectException (Exception \BadRequestException::class);
1388+
1389+ $ this ->mockRequest (
1390+ Client::METHOD_POST ,
1391+ $ path ,
1392+ null ,
1393+ null ,
1394+ true ,
1395+ null ,
1396+ null ,
1397+ 400
1398+ );
1399+
1400+ $ this ->userManagement ->resendInvitation ($ invitationId );
1401+ }
1402+
1403+ public function testResendInvitationAccepted ()
1404+ {
1405+ $ invitationId = "invitation_01E4ZCR3C56J083X43JQXF3JK5 " ;
1406+ $ path = "user_management/invitations/ {$ invitationId }/resend " ;
1407+
1408+ $ this ->expectException (Exception \BadRequestException::class);
1409+
1410+ $ this ->mockRequest (
1411+ Client::METHOD_POST ,
1412+ $ path ,
1413+ null ,
1414+ null ,
1415+ true ,
1416+ null ,
1417+ null ,
1418+ 400
1419+ );
1420+
1421+ $ this ->userManagement ->resendInvitation ($ invitationId );
1422+ }
1423+
13171424 public function testGetJwksUrl ()
13181425 {
13191426 $ clientId = "12345 " ;
0 commit comments