@@ -1039,6 +1039,35 @@ public function testCreateOrganizationMembershipWithRoleSlugs()
10391039 $ this ->assertSame ($ organizationMembership , $ response ->toArray ());
10401040 }
10411041
1042+ public function testCreateOrganizationMembershipWithNullRoleParams ()
1043+ {
1044+ $ userId = "user_01H7X1M4TZJN5N4HG4XXMA1234 " ;
1045+ $ orgId = "org_01EHQMYV6MBK39QC5PZXHY59C3 " ;
1046+ $ path = "user_management/organization_memberships " ;
1047+
1048+ $ result = $ this ->organizationMembershipResponseFixture ();
1049+
1050+ // When both roleSlug and roleSlugs are null, neither should be in params
1051+ $ params = [
1052+ "organization_id " => $ orgId ,
1053+ "user_id " => $ userId ,
1054+ ];
1055+
1056+ $ this ->mockRequest (
1057+ Client::METHOD_POST ,
1058+ $ path ,
1059+ null ,
1060+ $ params ,
1061+ true ,
1062+ $ result
1063+ );
1064+
1065+ $ organizationMembership = $ this ->organizationMembershipFixture ();
1066+
1067+ $ response = $ this ->userManagement ->createOrganizationMembership ($ userId , $ orgId , null , null );
1068+ $ this ->assertSame ($ organizationMembership , $ response ->toArray ());
1069+ }
1070+
10421071 public function testGetOrganizationMembership ()
10431072 {
10441073 $ organizationMembershipId = "om_01E4ZCR3C56J083X43JQXF3JK5 " ;
@@ -1207,16 +1236,10 @@ public function testUpdateOrganizationMembership()
12071236 $ this ->assertSame ($ this ->organizationMembershipFixture (), $ response ->toArray ());
12081237 }
12091238
1210- <<<<<<< HEAD
12111239 public function testUpdateOrganizationMembershipWithRoleSlugs ()
12121240 {
12131241 $ organizationMembershipId = "om_01E4ZCR3C56J083X43JQXF3JK5 " ;
12141242 $ roleSlugs = ["admin " ];
1215- =======
1216- public function testUpdateOrganizationMembershipWithNullRoleSlug ()
1217- {
1218- $ organizationMembershipId = "om_01E4ZCR3C56J083X43JQXF3JK5 " ;
1219- >>>>>>> 560 a945 (Fix PHP 8.4 deprecation: Add explicit nullable type hints)
12201243 $ path = "user_management/organization_memberships/ {$ organizationMembershipId }" ;
12211244
12221245 $ result = $ this ->organizationMembershipResponseFixture ();
@@ -1225,27 +1248,36 @@ public function testUpdateOrganizationMembershipWithNullRoleSlug()
12251248 Client::METHOD_PUT ,
12261249 $ path ,
12271250 null ,
1228- <<<<<<< HEAD
12291251 ["role_slugs " => $ roleSlugs ],
1230- =======
1231- ["role_slug " => null ],
1232- >>>>>>> 560 a945 (Fix PHP 8.4 deprecation: Add explicit nullable type hints)
12331252 true ,
12341253 $ result
12351254 );
12361255
1237- <<<<<<< HEAD
12381256 $ response = $ this ->userManagement ->updateOrganizationMembership ($ organizationMembershipId , null , $ roleSlugs );
12391257 $ this ->assertSame ($ this ->organizationMembershipFixture (), $ response ->toArray ());
12401258 }
12411259
1260+ public function testUpdateOrganizationMembershipWithNullRoleParams ()
1261+ {
1262+ $ organizationMembershipId = "om_01E4ZCR3C56J083X43JQXF3JK5 " ;
1263+ $ path = "user_management/organization_memberships/ {$ organizationMembershipId }" ;
1264+
1265+ $ result = $ this ->organizationMembershipResponseFixture ();
1266+
1267+ // When both roleSlug and roleSlugs are null, params should be empty array
1268+ $ this ->mockRequest (
1269+ Client::METHOD_PUT ,
1270+ $ path ,
1271+ null ,
1272+ [],
1273+ true ,
1274+ $ result
1275+ );
12421276
1243- =======
1244- $ response = $ this ->userManagement ->updateOrganizationMembership ($ organizationMembershipId , null );
1277+ $ response = $ this ->userManagement ->updateOrganizationMembership ($ organizationMembershipId , null , null );
12451278 $ this ->assertSame ($ this ->organizationMembershipFixture (), $ response ->toArray ());
12461279 }
12471280
1248- >>>>>>> 560 a945 (Fix PHP 8.4 deprecation: Add explicit nullable type hints)
12491281 public function testDeactivateOrganizationMembership ()
12501282 {
12511283 $ organizationMembershipId = "om_01E4ZCR3C56J083X43JQXF3JK5 " ;
@@ -1328,6 +1360,43 @@ public function testSendInvitation()
13281360 $ this ->assertSame ($ response ->toArray (), $ expected );
13291361 }
13301362
1363+ public function testSendInvitationWithNullOptionalParams ()
1364+ {
1365+ $ path = "user_management/invitations " ;
1366+
1367+ $ result = $ this ->invitationResponseFixture ();
1368+
1369+ // The implementation includes null values in params
1370+ $ params = [
1371+ 1372+ "organization_id " => null ,
1373+ "expires_in_days " => null ,
1374+ "inviter_user_id " => null ,
1375+ "role_slug " => null
1376+ ];
1377+
1378+ $ this ->mockRequest (
1379+ Client::METHOD_POST ,
1380+ $ path ,
1381+ null ,
1382+ $ params ,
1383+ true ,
1384+ $ result
1385+ );
1386+
1387+ $ response = $ this ->userManagement ->sendInvitation (
1388+ 1389+ null ,
1390+ null ,
1391+ null ,
1392+ null
1393+ );
1394+
1395+ $ expected = $ this ->invitationFixture ();
1396+
1397+ $ this ->assertSame ($ response ->toArray (), $ expected );
1398+ }
1399+
13311400 public function testGetInvitation ()
13321401 {
13331402 $ invitationId = "invitation_01E4ZCR3C56J083X43JQXF3JK5 " ;
0 commit comments