Skip to content

Commit

Permalink
Add profile_picture_url attribute to the user object (#210)
Browse files Browse the repository at this point in the history
* Add profile_picture_url

* Fix tests

* Fix tests

* Fix tests
  • Loading branch information
hadihallak authored Feb 7, 2024
1 parent dfdd673 commit aa0262e
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 21 deletions.
2 changes: 2 additions & 0 deletions lib/Resource/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class User extends BaseWorkOSResource
"firstName",
"lastName",
"emailVerified",
"profilePictureUrl",
"createdAt",
"updatedAt"
];
Expand All @@ -27,6 +28,7 @@ class User extends BaseWorkOSResource
"first_name" => "firstName",
"last_name" => "lastName",
"email_verified" => "emailVerified",
"profile_picture_url" => "profilePictureUrl",
"created_at" => "createdAt",
"updated_at" => "updatedAt"
];
Expand Down
53 changes: 32 additions & 21 deletions tests/WorkOS/UserManagementTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -876,19 +876,21 @@ private function invitationListResponseFixture()
{
return json_encode(
[
"data" => [[
"object" => "invitation",
"id" => "invitation_01E4ZCR3C56J083X43JQXF3JK5",
"email" => "[email protected]",
"state" => "pending",
"accepted_at" => "2021-07-01T19:07:33.155Z",
"revoked_at" => "2021-07-01T19:07:33.155Z",
"expires_at" => "2021-07-01T19:07:33.155Z",
"token" => "Z1uX3RbwcIl5fIGJJJCXXisdI",
"organization_id" => "org_01EHQMYV6MBK39QC5PZXHY59C3",
"created_at" => "2021-07-01T19:07:33.155Z",
"updated_at" => "2021-07-01T19:07:33.155Z",
]],
"data" => [
[
"object" => "invitation",
"id" => "invitation_01E4ZCR3C56J083X43JQXF3JK5",
"email" => "[email protected]",
"state" => "pending",
"accepted_at" => "2021-07-01T19:07:33.155Z",
"revoked_at" => "2021-07-01T19:07:33.155Z",
"expires_at" => "2021-07-01T19:07:33.155Z",
"token" => "Z1uX3RbwcIl5fIGJJJCXXisdI",
"organization_id" => "org_01EHQMYV6MBK39QC5PZXHY59C3",
"created_at" => "2021-07-01T19:07:33.155Z",
"updated_at" => "2021-07-01T19:07:33.155Z",
]
],
"list_metadata" => [
"before" => null,
"after" => null
Expand All @@ -913,14 +915,16 @@ private function organizationMembershipListResponseFixture()
{
return json_encode(
[
"data" => [[
"object" => "organization_membership",
"id" => "om_01E4ZCR3C56J083X43JQXF3JK5",
"user_id" => "user_01H7X1M4TZJN5N4HG4XXMA1234",
"organization_id" => "org_01EHQMYV6MBK39QC5PZXHY59C3",
"created_at" => "2021-06-25T19:07:33.155Z",
"updated_at" => "2021-06-25T19:07:33.155Z",
]],
"data" => [
[
"object" => "organization_membership",
"id" => "om_01E4ZCR3C56J083X43JQXF3JK5",
"user_id" => "user_01H7X1M4TZJN5N4HG4XXMA1234",
"organization_id" => "org_01EHQMYV6MBK39QC5PZXHY59C3",
"created_at" => "2021-06-25T19:07:33.155Z",
"updated_at" => "2021-06-25T19:07:33.155Z",
]
],
"list_metadata" => [
"before" => null,
"after" => null
Expand Down Expand Up @@ -1001,6 +1005,7 @@ private function userResponseFixture()
"first_name" => "Damien",
"last_name" => "Alabaster",
"email_verified" => true,
"profile_picture_url" => "https://example.com/photo.jpg",
"created_at" => "2021-06-25T19:07:33.155Z",
"updated_at" => "2021-06-25T19:07:33.155Z"
]
Expand All @@ -1018,6 +1023,7 @@ private function createUserAndTokenResponseFixture()
"first_name" => "Damien",
"last_name" => "Alabaster",
"email_verified" => true,
'profile_picture_url' => 'https://example.com/photo.jpg',
"created_at" => "2021-06-25T19:07:33.155Z",
"updated_at" => "2021-06-25T19:07:33.155Z"
]
Expand All @@ -1033,6 +1039,7 @@ private function createUserResponseFixture()
"first_name" => "Damien",
"last_name" => "Alabaster",
"email_verified" => true,
'profile_picture_url' => 'https://example.com/photo.jpg',
"created_at" => "2021-06-25T19:07:33.155Z",
"updated_at" => "2021-06-25T19:07:33.155Z"
]);
Expand All @@ -1055,6 +1062,7 @@ private function getUserResponseFixture()
"first_name" => "Damien",
"last_name" => "Alabaster",
"email_verified" => true,
"profile_picture_url" => "https://example.com/photo.jpg",
"created_at" => "2021-06-25T19:07:33.155Z",
"updated_at" => "2021-06-25T19:07:33.155Z"
]);
Expand All @@ -1071,6 +1079,7 @@ private function listUsersResponseFixture()
"first_name" => "Damien",
"last_name" => "Alabaster",
"email_verified" => true,
"profile_picture_url" => "https://example.com/photo.jpg",
"created_at" => "2021-06-25T19:07:33.155Z",
"updated_at" => "2021-06-25T19:07:33.155Z"
]
Expand Down Expand Up @@ -1099,6 +1108,7 @@ private function userFixture()
"firstName" => "Damien",
"lastName" => "Alabaster",
"emailVerified" => true,
"profilePictureUrl" => "https://example.com/photo.jpg",
"createdAt" => "2021-06-25T19:07:33.155Z",
"updatedAt" => "2021-06-25T19:07:33.155Z"
];
Expand All @@ -1114,6 +1124,7 @@ private function userAndOrgResponseFixture()
"first_name" => "Damien",
"last_name" => "Alabaster",
"email_verified" => true,
"profile_picture_url" => "https://example.com/photo.jpg",
"created_at" => "2021-06-25T19:07:33.155Z",
"updated_at" => "2021-06-25T19:07:33.155Z"
],
Expand Down

0 comments on commit aa0262e

Please sign in to comment.