44
55use PHPUnit \Framework \Attributes \DataProvider ;
66use PHPUnit \Framework \TestCase ;
7+ use WorkOS \Resource \RoleResponse ;
78
89class UserManagementTest extends TestCase
910{
@@ -1010,7 +1011,7 @@ public function testCreateOrganizationMembership()
10101011
10111012 $ response = $ this ->userManagement ->createOrganizationMembership ($ userId , $ orgId , $ roleSlug );
10121013
1013- $ this ->assertSame ($ organizationMembership , $ response ->toArray ());
1014+ $ this ->assertEquals ($ organizationMembership , $ response ->toArray ());
10141015 }
10151016
10161017 public function testCreateOrganizationMembershipWithRoleSlugs ()
@@ -1041,7 +1042,7 @@ public function testCreateOrganizationMembershipWithRoleSlugs()
10411042
10421043 $ response = $ this ->userManagement ->createOrganizationMembership ($ userId , $ orgId , null , $ roleSlugs );
10431044
1044- $ this ->assertSame ($ organizationMembership , $ response ->toArray ());
1045+ $ this ->assertEquals ($ organizationMembership , $ response ->toArray ());
10451046 }
10461047
10471048 public function testCreateOrganizationMembershipWithNullRoleParams ()
@@ -1093,7 +1094,7 @@ public function testGetOrganizationMembership()
10931094
10941095 $ response = $ this ->userManagement ->getOrganizationMembership ($ organizationMembershipId );
10951096
1096- $ this ->assertSame ($ organizationMembership , $ response ->toArray ());
1097+ $ this ->assertEquals ($ organizationMembership , $ response ->toArray ());
10971098 }
10981099
10991100 public function testListOrganizationMemberships ()
@@ -1127,7 +1128,7 @@ public function testListOrganizationMemberships()
11271128
11281129 list ($ before , $ after , $ organizationMemberships ) = $ this ->userManagement ->listOrganizationMemberships ($ userId , $ orgId );
11291130
1130- $ this ->assertSame ($ organizationMembership , $ organizationMemberships [0 ]->toArray ());
1131+ $ this ->assertEquals ($ organizationMembership , $ organizationMemberships [0 ]->toArray ());
11311132 }
11321133
11331134 public function testListOrganizationMembershipsWithStatuses ()
@@ -1162,7 +1163,7 @@ public function testListOrganizationMembershipsWithStatuses()
11621163
11631164 list ($ before , $ after , $ organizationMemberships ) = $ this ->userManagement ->listOrganizationMemberships ($ userId , $ orgId , $ statuses );
11641165
1165- $ this ->assertSame ($ organizationMembership , $ organizationMemberships [0 ]->toArray ());
1166+ $ this ->assertEquals ($ organizationMembership , $ organizationMemberships [0 ]->toArray ());
11661167 }
11671168
11681169 public function testListOrganizationMembershipsWithStatus ()
@@ -1197,7 +1198,7 @@ public function testListOrganizationMembershipsWithStatus()
11971198
11981199 list ($ before , $ after , $ organizationMemberships ) = $ this ->userManagement ->listOrganizationMemberships ($ userId , $ orgId , $ statuses );
11991200
1200- $ this ->assertSame ($ organizationMembership , $ organizationMemberships [0 ]->toArray ());
1201+ $ this ->assertEquals ($ organizationMembership , $ organizationMemberships [0 ]->toArray ());
12011202 }
12021203
12031204 public function testDeleteOrganizationMembership ()
@@ -1238,7 +1239,7 @@ public function testUpdateOrganizationMembership()
12381239 );
12391240
12401241 $ response = $ this ->userManagement ->updateOrganizationMembership ($ organizationMembershipId , $ roleSlug );
1241- $ this ->assertSame ($ this ->organizationMembershipFixture (), $ response ->toArray ());
1242+ $ this ->assertEquals ($ this ->organizationMembershipFixture (), $ response ->toArray ());
12421243 }
12431244
12441245 public function testUpdateOrganizationMembershipWithRoleSlugs ()
@@ -1259,7 +1260,7 @@ public function testUpdateOrganizationMembershipWithRoleSlugs()
12591260 );
12601261
12611262 $ response = $ this ->userManagement ->updateOrganizationMembership ($ organizationMembershipId , null , $ roleSlugs );
1262- $ this ->assertSame ($ this ->organizationMembershipFixture (), $ response ->toArray ());
1263+ $ this ->assertEquals ($ this ->organizationMembershipFixture (), $ response ->toArray ());
12631264 }
12641265
12651266 public function testUpdateOrganizationMembershipWithNullRoleParams ()
@@ -1303,7 +1304,7 @@ public function testDeactivateOrganizationMembership()
13031304
13041305 $ response = $ this ->userManagement ->deactivateOrganizationMembership ($ organizationMembershipId );
13051306
1306- $ this ->assertSame (array_merge ($ organizationMembership , array ("status " => "inactive " )), $ response ->toArray ());
1307+ $ this ->assertEquals (array_merge ($ organizationMembership , array ("status " => "inactive " )), $ response ->toArray ());
13071308 }
13081309
13091310 public function testReactivateOrganizationMembership ()
@@ -1326,7 +1327,7 @@ public function testReactivateOrganizationMembership()
13261327
13271328 $ response = $ this ->userManagement ->reactivateOrganizationMembership ($ organizationMembershipId );
13281329
1329- $ this ->assertSame ($ organizationMembership , $ response ->toArray ());
1330+ $ this ->assertEquals ($ organizationMembership , $ response ->toArray ());
13301331 }
13311332
13321333 public function testSendInvitation ()
@@ -1792,13 +1793,9 @@ private function organizationMembershipFixture()
17921793 "id " => "om_01E4ZCR3C56J083X43JQXF3JK5 " ,
17931794 "userId " => "user_01H7X1M4TZJN5N4HG4XXMA1234 " ,
17941795 "organizationId " => "org_01EHQMYV6MBK39QC5PZXHY59C3 " ,
1795- "role " => [
1796- "slug " => "admin " ,
1797- ],
1796+ "role " => new RoleResponse ("admin " ),
17981797 "roles " => [
1799- [
1800- "slug " => "admin " ,
1801- ],
1798+ new RoleResponse ("admin " ),
18021799 ],
18031800 "status " => "active " ,
18041801 "createdAt " => "2021-06-25T19:07:33.155Z " ,
0 commit comments