summaryrefslogtreecommitdiffstats
path: root/tests/php
diff options
context:
space:
mode:
authorVitor Mattos <vitor@php.rio>2023-05-01 14:31:28 -0300
committerVitor Mattos <vitor@php.rio>2023-05-03 04:58:45 -0300
commitcb3fa784d49afd72587130ec7fe9b3b71bb12a13 (patch)
tree4e25f4d54ad50b439eed67e3a881fb2b50bbe3e3 /tests/php
parentb140bcf69116e5732c510f83ca368f7ed816cb12 (diff)
Fixes to be able identify if have a custom avatar
* Added the header X-NC-IsCustomAvatar * Return every time a non empty string as avatarVersion Signed-off-by: Vitor Mattos <vitor@php.rio>
Diffstat (limited to 'tests/php')
-rw-r--r--tests/php/Service/AvatarServiceTest.php11
1 files changed, 7 insertions, 4 deletions
diff --git a/tests/php/Service/AvatarServiceTest.php b/tests/php/Service/AvatarServiceTest.php
index 97cfc80fe..44fa822ae 100644
--- a/tests/php/Service/AvatarServiceTest.php
+++ b/tests/php/Service/AvatarServiceTest.php
@@ -83,16 +83,19 @@ class AvatarServiceTest extends TestCase {
public function testGetAvatarVersion(string $avatar, string $expected): void {
/** @var Room|MockObject $room */
$room = $this->createMock(Room::class);
- $room->expects($this->once())
- ->method('getAvatar')
+ $room->method('getAvatar')
->willReturn($avatar);
$actual = $this->service->getAvatarVersion($room);
- $this->assertEquals($expected, $actual);
+ if ($expected === 'STRING WITH 8 CHARS') {
+ $this->assertEquals(8, strlen($actual));
+ } else {
+ $this->assertEquals($expected, $actual);
+ }
}
public function dataGetAvatarVersion(): array {
return [
- ['', ''],
+ ['', 'STRING WITH 8 CHARS'],
['1', '1'],
['1.png', '1'],
];