From 9b149ec349a513433cb474824f5b32ee6c9ee399 Mon Sep 17 00:00:00 2001 From: harsh mahajan Date: Tue, 15 Sep 2026 11:46:37 +0530 Subject: [PATCH] test(avatars): compare handle initials with the plain name over the API --- tests/e2e/Services/Avatars/AvatarsBase.php | 25 +++++++++++++--------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/tests/e2e/Services/Avatars/AvatarsBase.php b/tests/e2e/Services/Avatars/AvatarsBase.php index 5c06f41718..cd95aa90b2 100644 --- a/tests/e2e/Services/Avatars/AvatarsBase.php +++ b/tests/e2e/Services/Avatars/AvatarsBase.php @@ -539,18 +539,23 @@ trait AvatarsBase public function testGetInitialsHandle(): void { - $response = $this->client->call(Client::METHOD_GET, '/avatars/initials', [ - 'x-appwrite-project' => $this->getProject()['$id'], - ], [ - 'name' => '@ItzNotABug', - 'width' => 100, - 'height' => 100, - ]); + $signatures = []; - $image = new \Imagick(); - $image->readImageBlob($response['body']); + foreach (['@ItzNotABug', 'ItzNotABug'] as $name) { + $response = $this->client->call(Client::METHOD_GET, '/avatars/initials', [ + 'x-appwrite-project' => $this->getProject()['$id'], + ], [ + 'name' => $name, + 'width' => 100, + 'height' => 100, + ]); - $this->assertGreaterThan(1, $image->getImageColors(), 'A handle rendered a blank square.'); + $image = new \Imagick(); + $image->readImageBlob($response['body']); + $signatures[] = $image->getImageSignature(); + } + + $this->assertSame($signatures[1], $signatures[0], 'A handle rendered differently from its name.'); } public function testInitialImage()