From aa0262e790b4b8fa1a67028feaec9bef3555916b Mon Sep 17 00:00:00 2001 From: Abdul Date: Wed, 7 Feb 2024 18:03:42 +0400 Subject: [PATCH] Add profile_picture_url attribute to the user object (#210) * Add profile_picture_url * Fix tests * Fix tests * Fix tests --- lib/Resource/User.php | 2 ++ tests/WorkOS/UserManagementTest.php | 53 +++++++++++++++++------------ 2 files changed, 34 insertions(+), 21 deletions(-) diff --git a/lib/Resource/User.php b/lib/Resource/User.php index 13fa8f0..a72b437 100644 --- a/lib/Resource/User.php +++ b/lib/Resource/User.php @@ -16,6 +16,7 @@ class User extends BaseWorkOSResource "firstName", "lastName", "emailVerified", + "profilePictureUrl", "createdAt", "updatedAt" ]; @@ -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" ]; diff --git a/tests/WorkOS/UserManagementTest.php b/tests/WorkOS/UserManagementTest.php index 79b5e72..44851ec 100644 --- a/tests/WorkOS/UserManagementTest.php +++ b/tests/WorkOS/UserManagementTest.php @@ -876,19 +876,21 @@ private function invitationListResponseFixture() { return json_encode( [ - "data" => [[ - "object" => "invitation", - "id" => "invitation_01E4ZCR3C56J083X43JQXF3JK5", - "email" => "someemail@test.com", - "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" => "someemail@test.com", + "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 @@ -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 @@ -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" ] @@ -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" ] @@ -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" ]); @@ -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" ]); @@ -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" ] @@ -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" ]; @@ -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" ],