feat: update testCreateCustomExecution()

This commit is contained in:
Christy Jacob
2022-01-25 03:38:11 +04:00
parent 156e160116
commit 0372c8e096
@@ -158,7 +158,7 @@ class FunctionsCustomClientTest extends Scope
$this->assertEquals(201, $function['headers']['status-code']);
$tag = $this->client->call(Client::METHOD_POST, '/functions/'.$functionId.'/tags', [
$deployment = $this->client->call(Client::METHOD_POST, '/functions/'.$functionId.'/deployments', [
'content-type' => 'multipart/form-data',
'x-appwrite-project' => $projectId,
'x-appwrite-key' => $apikey,
@@ -167,19 +167,19 @@ class FunctionsCustomClientTest extends Scope
'code' => new CURLFile(realpath(__DIR__ . '/../../../resources/functions/php-fn.tar.gz'), 'application/x-gzip', 'php-fx.tar.gz'), //different tarball names intentional
]);
$tagId = $tag['body']['$id'] ?? '';
$deploymentId = $deployment['body']['$id'] ?? '';
// Wait for tag to be built.
// Wait for deployment to be built.
sleep(5);
$this->assertEquals(201, $tag['headers']['status-code']);
$this->assertEquals(201, $deployment['headers']['status-code']);
$function = $this->client->call(Client::METHOD_PATCH, '/functions/'.$functionId.'/tag', [
$function = $this->client->call(Client::METHOD_PATCH, '/functions/'.$functionId.'/deployment', [
'content-type' => 'application/json',
'x-appwrite-project' => $projectId,
'x-appwrite-key' => $apikey,
], [
'tag' => $tagId,
'deployment' => $deploymentId,
]);
$this->assertEquals(200, $function['headers']['status-code']);