test(avatars): compare handle initials with the plain name over the API

This commit is contained in:
harsh mahajan committed 2026-09-15 11:46:37 +05:30
1 parent 30c620c7ba
commit 9b149ec349
1 file changed
+15 -10
+15 -10
View File
@@ -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()