mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
Update GraphQL avatars test to validate response headers and content
Co-authored-by: jakeb994 <jakeb994@gmail.com>
This commit is contained in:
@@ -75,7 +75,9 @@ class AvatarsTest extends Scope
|
||||
'x-appwrite-project' => $projectId,
|
||||
], $this->getHeaders()), $graphQLPayload);
|
||||
|
||||
$this->assertEquals(8814, \strlen($countryFlag['body']));
|
||||
$this->assertEquals(200, $countryFlag['headers']['status-code']);
|
||||
$this->assertNotEmpty($countryFlag['body']);
|
||||
$this->assertStringContainsString('image/', $countryFlag['headers']['content-type']);
|
||||
|
||||
return $countryFlag['body'];
|
||||
}
|
||||
@@ -96,7 +98,9 @@ class AvatarsTest extends Scope
|
||||
'x-appwrite-project' => $projectId,
|
||||
], $this->getHeaders()), $graphQLPayload);
|
||||
|
||||
$this->assertEquals(52585, \strlen($image['body']));
|
||||
$this->assertEquals(200, $image['headers']['status-code']);
|
||||
$this->assertNotEmpty($image['body']);
|
||||
$this->assertStringContainsString('image/', $image['headers']['content-type']);
|
||||
|
||||
return $image['body'];
|
||||
}
|
||||
@@ -117,7 +121,9 @@ class AvatarsTest extends Scope
|
||||
'x-appwrite-project' => $projectId,
|
||||
], $this->getHeaders()), $graphQLPayload);
|
||||
|
||||
$this->assertEquals(5430, \strlen($favicon['body']));
|
||||
$this->assertEquals(200, $favicon['headers']['status-code']);
|
||||
$this->assertNotEmpty($favicon['body']);
|
||||
$this->assertStringContainsString('image/', $favicon['headers']['content-type']);
|
||||
|
||||
return $favicon['body'];
|
||||
}
|
||||
@@ -138,7 +144,9 @@ class AvatarsTest extends Scope
|
||||
'x-appwrite-project' => $projectId,
|
||||
], $this->getHeaders()), $graphQLPayload);
|
||||
|
||||
$this->assertEquals(9169, \strlen($qrCode['body']));
|
||||
$this->assertEquals(200, $qrCode['headers']['status-code']);
|
||||
$this->assertNotEmpty($qrCode['body']);
|
||||
$this->assertStringContainsString('image/', $qrCode['headers']['content-type']);
|
||||
|
||||
return $qrCode['body'];
|
||||
}
|
||||
@@ -159,7 +167,9 @@ class AvatarsTest extends Scope
|
||||
'x-appwrite-project' => $projectId,
|
||||
], $this->getHeaders()), $graphQLPayload);
|
||||
|
||||
$this->assertEquals(5025, \strlen($initials['body']));
|
||||
$this->assertEquals(200, $initials['headers']['status-code']);
|
||||
$this->assertNotEmpty($initials['body']);
|
||||
$this->assertStringContainsString('image/', $initials['headers']['content-type']);
|
||||
|
||||
return $initials['body'];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user