Test for functions.delete
This commit is contained in:
parent
ac7efc8d1b
commit
c0b020dd07
1 changed files with 33 additions and 0 deletions
|
@ -490,4 +490,37 @@ class WebhooksCustomServerTest extends Scope
|
||||||
|
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @depends testDeleteTag
|
||||||
|
*/
|
||||||
|
public function testDeleteFunction($data):array
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Test for SUCCESS
|
||||||
|
*/
|
||||||
|
$function = $this->client->call(Client::METHOD_DELETE, '/functions/'.$data['functionId'], array_merge([
|
||||||
|
'content-type' => 'application/json',
|
||||||
|
'x-appwrite-project' => $this->getProject()['$id'],
|
||||||
|
], $this->getHeaders()));
|
||||||
|
|
||||||
|
$this->assertEquals(204, $function['headers']['status-code']);
|
||||||
|
$this->assertEmpty($function['body']);
|
||||||
|
|
||||||
|
$webhook = $this->getLastRequest();
|
||||||
|
|
||||||
|
$this->assertEquals($webhook['method'], 'POST');
|
||||||
|
$this->assertEquals($webhook['headers']['Content-Type'], 'application/json');
|
||||||
|
$this->assertEquals($webhook['headers']['User-Agent'], 'Appwrite-Server vdev. Please report abuse at security@appwrite.io');
|
||||||
|
$this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Event'], 'functions.delete');
|
||||||
|
$this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Signature'], 'not-yet-implemented');
|
||||||
|
$this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Id'] ?? '', $this->getProject()['webhookId']);
|
||||||
|
$this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Project-Id'] ?? '', $this->getProject()['$id']);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test for FAILURE
|
||||||
|
*/
|
||||||
|
|
||||||
|
return $data;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue