mirror of
https://github.com/appwrite/appwrite.git
synced 2026-11-18 20:36:03 +00:00
test(avatars): compare handle initials with the plain name over the API
This commit is contained in:
1 parent
30c620c7ba
commit
9b149ec349
1 file changed
+15
-10
@@ -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()
|
||||
|
||||
Reference in new issue
Block a user