Fix avatars tests

Because the tests referenced images on the appwrite.io website, but the
appwrite.io website changed, the tests broke. This updates the tests to
reference valid images/URLs.

In addition, the favicon test was changed to use github.com because
appwrite.io has an SVG favicon which the avatars API does not support.
This commit is contained in:
Steven Nguyen 2023-09-29 10:25:22 -07:00
parent 583f8dbc54
commit f2feecf84e
No known key found for this signature in database

View file

@ -202,7 +202,7 @@ trait AvatarsBase
$response = $this->client->call(Client::METHOD_GET, '/avatars/image', [
'x-appwrite-project' => $this->getProject()['$id'],
], [
'url' => 'https://appwrite.io/images/apple.png',
'url' => 'https://appwrite.io/images/open-graph/website.png',
]);
$this->assertEquals(200, $response['headers']['status-code']);
@ -212,7 +212,7 @@ trait AvatarsBase
$response = $this->client->call(Client::METHOD_GET, '/avatars/image', [
'x-appwrite-project' => $this->getProject()['$id'],
], [
'url' => 'https://appwrite.io/images/apple.png',
'url' => 'https://appwrite.io/images/open-graph/website.png',
'width' => 200,
'height' => 200,
]);
@ -224,7 +224,7 @@ trait AvatarsBase
$response = $this->client->call(Client::METHOD_GET, '/avatars/image', [
'x-appwrite-project' => $this->getProject()['$id'],
], [
'url' => 'https://appwrite.io/images/apple.png',
'url' => 'https://appwrite.io/images/open-graph/website.png',
'width' => 300,
'height' => 300,
'quality' => 30,
@ -251,7 +251,7 @@ trait AvatarsBase
$response = $this->client->call(Client::METHOD_GET, '/avatars/image', [
'x-appwrite-project' => $this->getProject()['$id'],
], [
'url' => 'https://appwrite.io/images/apple.png',
'url' => 'https://appwrite.io/images/open-graph/website.png',
'width' => 2001,
'height' => 300,
'quality' => 30,
@ -280,11 +280,11 @@ trait AvatarsBase
$response = $this->client->call(Client::METHOD_GET, '/avatars/favicon', [
'x-appwrite-project' => $this->getProject()['$id'],
], [
'url' => 'https://appwrite.io/',
'url' => 'https://github.com/',
]);
$this->assertEquals(200, $response['headers']['status-code']);
$this->assertEquals('image/png', $response['headers']['content-type']);
$this->assertEquals('image/x-icon', $response['headers']['content-type']);
$this->assertNotEmpty($response['body']);
/**