1
0
Fork 0
mirror of synced 2024-07-06 07:00:56 +12:00

added messaging base test

This commit is contained in:
prateek banga 2023-08-25 03:09:12 +05:30
parent 048e8e81ba
commit 5960666068
2 changed files with 20 additions and 10 deletions

View file

@ -3,16 +3,10 @@
namespace Tests\E2E\Services\Messaging;
use Tests\E2E\Client;
use Tests\E2E\Scopes\ProjectCustom;
use Tests\E2E\Scopes\Scope;
use Tests\E2E\Scopes\SideServer;
class MessagingServerTest extends Scope
trait MessagingBase
{
use ProjectCustom;
use SideServer;
public function testCreateProviders(): array
public function testCreateProviders(): array
{
$providersParams = [
'sendgrid' => [
@ -77,7 +71,8 @@ class MessagingServerTest extends Scope
$response = $this->client->call(Client::METHOD_POST, '/messaging/providers/' . $key, \array_merge([
'content-type' => 'application/json',
'x-appwrite-project' => $this->getProject()['$id'],
],$this->getHeaders()), $providersParams[$key]);
'x-appwrite-key' => $this->getProject()['apiKey'],
]), $providersParams[$key]);
\array_push($providers, $response['body']);
$this->assertEquals(201, $response['headers']['status-code']);
$this->assertEquals($providersParams[$key]['name'], $response['body']['name']);
@ -195,4 +190,4 @@ class MessagingServerTest extends Scope
$this->assertEquals(204, $response['headers']['status-code']);
}
}
}
}

View file

@ -0,0 +1,15 @@
<?php
namespace Tests\E2E\Services\Messaging;
use Tests\E2E\Scopes\ProjectCustom;
use Tests\E2E\Scopes\Scope;
use Tests\E2E\Scopes\SideServer;
class MessagingCustomServerTest extends Scope
{
use MessagingBase;
use ProjectCustom;
use SideServer;
}