1
0
Fork 0
mirror of synced 2024-07-03 21:50:34 +12:00
appwrite/tests/e2e/Services/Functions/FunctionsCustomClientTest.php

43 lines
1.1 KiB
PHP
Raw Normal View History

2020-05-06 08:37:59 +12:00
<?php
namespace Tests\E2E\Services\Functions;
use Tests\E2E\Client;
use Tests\E2E\Scopes\ProjectCustom;
use Tests\E2E\Scopes\Scope;
use Tests\E2E\Scopes\SideClient;
2020-12-09 11:24:22 +13:00
class FunctionsCustomClientTest extends Scope
2020-05-06 08:37:59 +12:00
{
use FunctionsBase;
use ProjectCustom;
use SideClient;
public function testCreate():array
{
/**
* Test for SUCCESS
*/
$response1 = $this->client->call(Client::METHOD_POST, '/functions', array_merge([
'content-type' => 'application/json',
'x-appwrite-project' => $this->getProject()['$id'],
], $this->getHeaders()), [
'name' => 'Test',
'vars' => [
2020-08-10 03:03:52 +12:00
'funcKey1' => 'funcValue1',
'funcKey2' => 'funcValue2',
'funcKey3' => 'funcValue3',
2020-05-06 08:37:59 +12:00
],
'events' => [
'account.create',
'account.delete',
],
'schedule' => '* * * * *',
'timeout' => 10,
]);
$this->assertEquals(401, $response1['headers']['status-code']);
return [];
}
}