@@ -68,6 +68,10 @@ class ProfilePickerReferenceProviderTest extends TestCase {
68
68
'scope ' => IAccountManager::SCOPE_LOCAL ,
69
69
'value ' => 'Non-existing user ' ,
70
70
],
71
+ IAccountManager::PROPERTY_PROFILE_ENABLED => [
72
+ 'scope ' => IAccountManager::SCOPE_LOCAL ,
73
+ 'value ' => '1 ' ,
74
+ ],
71
75
],
72
76
'user2 ' => [
73
77
IAccountManager::PROPERTY_BIOGRAPHY => [
@@ -94,6 +98,10 @@ class ProfilePickerReferenceProviderTest extends TestCase {
94
98
'scope ' => IAccountManager::SCOPE_LOCAL ,
95
99
'value ' => 'Non-existing user ' ,
96
100
],
101
+ IAccountManager::PROPERTY_PROFILE_ENABLED => [
102
+ 'scope ' => IAccountManager::SCOPE_LOCAL ,
103
+ 'value ' => '1 ' ,
104
+ ],
97
105
],
98
106
'user3 ' => null ,
99
107
];
@@ -166,10 +174,10 @@ private function setupUserAccountReferenceExpectation(string $userId): ?IReferen
166
174
$ propertyMock = $ this ->createMock (IAccountProperty::class);
167
175
$ propertyMock ->expects ($ this ->any ())
168
176
->method ('getValue ' )
169
- ->willReturn ($ this ->testAccountsData [$ userId ][$ property ]['value ' ]);
177
+ ->willReturn ($ this ->testAccountsData [$ userId ][$ property ]['value ' ] ?? '' );
170
178
$ propertyMock ->expects ($ this ->any ())
171
179
->method ('getScope ' )
172
- ->willReturn ($ this ->testAccountsData [$ userId ][$ property ]['scope ' ]);
180
+ ->willReturn ($ this ->testAccountsData [$ userId ][$ property ]['scope ' ] ?? '' );
173
181
return $ propertyMock ;
174
182
});
175
183
@@ -194,7 +202,12 @@ private function setupUserAccountReferenceExpectation(string $userId): ?IReferen
194
202
'title ' => $ this ->testUsersData [$ userId ]['displayname ' ],
195
203
'subline ' => $ this ->testUsersData [$ userId ]['email ' ] ?? $ this ->testUsersData [$ userId ]['displayname ' ],
196
204
'email ' => $ this ->testUsersData [$ userId ]['email ' ],
197
- 'bio ' => $ bio !== null ? substr_replace ($ bio , '... ' , 80 , strlen ($ bio )) : null ,
205
+ 'bio ' => isset ($ bio ) && $ bio !== ''
206
+ ? (mb_strlen ($ bio ) > 80
207
+ ? (mb_substr ($ bio , 0 , 80 ) . '... ' )
208
+ : $ bio )
209
+ : null ,
210
+ 'full_bio ' => $ bio ,
198
211
'headline ' => $ this ->getTestAccountPropertyValue ($ userId , IAccountManager::PROPERTY_HEADLINE ),
199
212
'location ' => $ location ,
200
213
'location_url ' => $ location !== null ? 'https://www.openstreetmap.org/search?query= ' . urlencode ($ location ) : null ,
0 commit comments