1
0
Fork 0
mirror of synced 2024-06-03 11:24:48 +12:00
appwrite/tests/e2e/Services/Functions/FunctionsCustomClientTest.php
2020-05-12 23:18:34 +03:00

43 lines
1.1 KiB
PHP

<?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;
class FunctionsConsoleClientTest extends Scope
{
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' => [
'key1' => 'value1',
'key2' => 'value2',
'key3' => 'value3',
],
'events' => [
'account.create',
'account.delete',
],
'schedule' => '* * * * *',
'timeout' => 10,
]);
$this->assertEquals(401, $response1['headers']['status-code']);
return [];
}
}