1
0
Fork 0
mirror of synced 2024-10-02 10:16:27 +13:00

Fix tests

This commit is contained in:
Jake Barnby 2024-01-11 19:47:55 +13:00
parent 449e8cc06c
commit cb3e354cf1
No known key found for this signature in database
GPG key ID: C437A8CC85B96E9C
2 changed files with 4 additions and 50 deletions

View file

@ -216,54 +216,6 @@ App::post('/v1/projects')
} }
$dbForProject->createCollection($key, $attributes, $indexes); $dbForProject->createCollection($key, $attributes, $indexes);
} }
$emailProvider = new Document([
'$id' => ID::custom('mock-email-provider'),
'name' => 'mock',
'provider' => 'mock',
'type' => MESSAGE_TYPE_EMAIL,
'enabled' => true,
'credentials' => [
'username' => 'username',
'password' => 'password'
],
'options' => [
'from' => 'sender-email'
],
]);
$smsProvider = new Document([
'$id' => ID::custom('mock-sms-provider'),
'name' => 'mock',
'provider' => 'mock',
'type' => MESSAGE_TYPE_SMS,
'enabled' => true,
'credentials' => [
'username' => 'username',
'password' => 'password'
],
'options' => [
'from' => 'sender-email'
],
]);
$pushProvider = new Document([
'$id' => ID::custom('mock-push-provider'),
'name' => 'mock',
'provider' => 'mock',
'type' => MESSAGE_TYPE_PUSH,
'enabled' => true,
'credentials' => [
'username' => 'username',
'password' => 'password'
],
'options' => [
'from' => 'sender-email'
],
]);
$dbForProject->createDocument('providers', $emailProvider);
$dbForProject->createDocument('providers', $smsProvider);
$dbForProject->createDocument('providers', $pushProvider);
$response $response
->setStatusCode(Response::STATUS_CODE_CREATED) ->setStatusCode(Response::STATUS_CODE_CREATED)

View file

@ -608,7 +608,7 @@ trait MessagingBase
'name' => 'Sendgrid-provider', 'name' => 'Sendgrid-provider',
'apiKey' => $apiKey, 'apiKey' => $apiKey,
'fromName' => $fromName, 'fromName' => $fromName,
'fromEmail' => $fromEmail 'fromEmail' => $fromEmail,
'enabled' => true, 'enabled' => true,
]); ]);
@ -765,7 +765,8 @@ trait MessagingBase
'name' => 'Msg91Sender', 'name' => 'Msg91Sender',
'senderId' => $senderId, 'senderId' => $senderId,
'authKey' => $authKey, 'authKey' => $authKey,
'from' => $from 'from' => $from,
'enabled' => true,
]); ]);
$this->assertEquals(201, $provider['headers']['status-code']); $this->assertEquals(201, $provider['headers']['status-code']);
@ -926,6 +927,7 @@ trait MessagingBase
'providerId' => ID::unique(), 'providerId' => ID::unique(),
'name' => 'FCM-1', 'name' => 'FCM-1',
'serviceAccountJSON' => $serviceAccountJSON, 'serviceAccountJSON' => $serviceAccountJSON,
'enabled' => true,
]); ]);
$this->assertEquals(201, $provider['headers']['status-code']); $this->assertEquals(201, $provider['headers']['status-code']);