1
0
Fork 0
mirror of synced 2024-06-02 19:04:49 +12:00

feat: fix tests

This commit is contained in:
Christy Jacob 2022-02-06 15:19:33 +04:00
parent 6ab1095280
commit 7735b67a3f
2 changed files with 4 additions and 4 deletions

View file

@ -334,16 +334,16 @@ class FunctionsV1 extends Worker
->setParam('projectId', $projectId)
->setParam('userId', $userId)
->setParam('webhooks', $webhooks)
->setParam('event', 'functions.executions.update')
->setParam('event', $event)
->setParam('eventData', $execution->getArrayCopy(array_keys($executionModel->getRules())));
$executionUpdate->trigger();
/** Trigger realtime event */
$target = Realtime::fromPayload('functions.executions.update', $execution);
$target = Realtime::fromPayload($event, $execution);
Realtime::send(
projectId: $projectId,
payload: $execution->getArrayCopy(),
event: 'functions.executions.update',
event: $event,
channels: $target['channels'],
roles: $target['roles']
);

View file

@ -476,7 +476,7 @@ class WebhooksCustomServerTest extends Scope
$execution = $this->client->call(Client::METHOD_POST, '/functions/'.$data['functionId'].'/executions', array_merge([
'content-type' => 'application/json',
'x-appwrite-project' => $this->getProject()['$id'],
], $this->getHeaders()), ['executionId' => 'unique()',]);
], $this->getHeaders()), []);
$this->assertEquals($execution['headers']['status-code'], 201);
$this->assertNotEmpty($execution['body']['$id']);