Test fixes
This commit is contained in:
parent
f37bddbc6d
commit
e3bed0c636
14 changed files with 30 additions and 13 deletions
|
@ -838,7 +838,7 @@ return [
|
||||||
'variables' => [
|
'variables' => [
|
||||||
[
|
[
|
||||||
'name' => '_APP_GRAPHQL_MAX_BATCH_SIZE',
|
'name' => '_APP_GRAPHQL_MAX_BATCH_SIZE',
|
||||||
'description' => 'Maximum number of batched queries per request. The default value is 50.',
|
'description' => 'Maximum number of batched queries per request. The default value is 10.',
|
||||||
'introduction' => '0.17.0',
|
'introduction' => '0.17.0',
|
||||||
'default' => '10',
|
'default' => '10',
|
||||||
'required' => false,
|
'required' => false,
|
||||||
|
@ -847,7 +847,7 @@ return [
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'name' => '_APP_GRAPHQL_MAX_COMPLEXITY',
|
'name' => '_APP_GRAPHQL_MAX_COMPLEXITY',
|
||||||
'description' => 'Maximum complexity of a GraphQL query. The default value is 200.',
|
'description' => 'Maximum complexity of a GraphQL query. The default value is 50.',
|
||||||
'introduction' => '0.17.0',
|
'introduction' => '0.17.0',
|
||||||
'default' => '50',
|
'default' => '50',
|
||||||
'required' => false,
|
'required' => false,
|
||||||
|
|
|
@ -70,7 +70,7 @@ App::post('/v1/teams')
|
||||||
if (!\in_array('owner', $roles)) {
|
if (!\in_array('owner', $roles)) {
|
||||||
$roles[] = 'owner';
|
$roles[] = 'owner';
|
||||||
}
|
}
|
||||||
|
|
||||||
$membershipId = $dbForProject->getId();
|
$membershipId = $dbForProject->getId();
|
||||||
$membership = new Document([
|
$membership = new Document([
|
||||||
'$id' => $membershipId,
|
'$id' => $membershipId,
|
||||||
|
|
|
@ -32,7 +32,7 @@ class Resolvers
|
||||||
|
|
||||||
$path = $route->getPath();
|
$path = $route->getPath();
|
||||||
foreach ($args as $key => $value) {
|
foreach ($args as $key => $value) {
|
||||||
if (\str_contains($path, $key)) {
|
if (\str_contains($path, '/:' . $key)) {
|
||||||
$path = \str_replace(':' . $key, $value, $path);
|
$path = \str_replace(':' . $key, $value, $path);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -444,8 +444,8 @@ class GraphQLAccountTest extends Scope
|
||||||
'x-appwrite-project' => $projectId,
|
'x-appwrite-project' => $projectId,
|
||||||
], $this->getHeaders()), $graphQLPayload);
|
], $this->getHeaders()), $graphQLPayload);
|
||||||
|
|
||||||
|
$this->assertIsNotArray($account['body']);
|
||||||
$this->assertEquals(204, $account['headers']['status-code']);
|
$this->assertEquals(204, $account['headers']['status-code']);
|
||||||
$this->assertEmpty($account['body']);
|
|
||||||
|
|
||||||
unset(self::$user[$this->getProject()['$id']]);
|
unset(self::$user[$this->getProject()['$id']]);
|
||||||
$this->getUser();
|
$this->getUser();
|
||||||
|
@ -469,6 +469,7 @@ class GraphQLAccountTest extends Scope
|
||||||
'x-appwrite-project' => $projectId,
|
'x-appwrite-project' => $projectId,
|
||||||
], $this->getHeaders()), $graphQLPayload);
|
], $this->getHeaders()), $graphQLPayload);
|
||||||
|
|
||||||
|
$this->assertIsNotArray($account['body']);
|
||||||
$this->assertEquals(204, $account['headers']['status-code']);
|
$this->assertEquals(204, $account['headers']['status-code']);
|
||||||
|
|
||||||
unset(self::$user[$this->getProject()['$id']]);
|
unset(self::$user[$this->getProject()['$id']]);
|
||||||
|
|
|
@ -235,6 +235,7 @@ class GraphQLAuthTest extends Scope
|
||||||
'cookie' => 'a_session_' . $projectId . '=' . $this->token1,
|
'cookie' => 'a_session_' . $projectId . '=' . $this->token1,
|
||||||
], $gqlPayload);
|
], $gqlPayload);
|
||||||
|
|
||||||
|
$this->assertIsNotArray($document['body']);
|
||||||
$this->assertEquals(204, $document['headers']['status-code']);
|
$this->assertEquals(204, $document['headers']['status-code']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1057,8 +1057,8 @@ trait GraphQLBase
|
||||||
}
|
}
|
||||||
}';
|
}';
|
||||||
case self::$DELETE_TEAM_MEMBERSHIP:
|
case self::$DELETE_TEAM_MEMBERSHIP:
|
||||||
return 'mutation deleteTeamMembership($teamId: String!, $userId: String!){
|
return 'mutation deleteTeamMembership($teamId: String!, $membershipId: String!){
|
||||||
teamsDeleteMembership(teamId: $teamId, userId: $userId)
|
teamsDeleteMembership(teamId: $teamId, membershipId: $membershipId)
|
||||||
}';
|
}';
|
||||||
case self::$GET_FUNCTION:
|
case self::$GET_FUNCTION:
|
||||||
return 'query getFunction($functionId: String!) {
|
return 'query getFunction($functionId: String!) {
|
||||||
|
|
|
@ -288,6 +288,7 @@ class GraphQLDatabaseClientTest extends Scope
|
||||||
'x-appwrite-project' => $projectId,
|
'x-appwrite-project' => $projectId,
|
||||||
], $this->getHeaders()), $gqlPayload);
|
], $this->getHeaders()), $gqlPayload);
|
||||||
|
|
||||||
|
$this->assertIsNotArray($document['body']);
|
||||||
$this->assertEquals(204, $document['headers']['status-code']);
|
$this->assertEquals(204, $document['headers']['status-code']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -843,6 +843,7 @@ class GraphQLDatabaseServerTest extends Scope
|
||||||
'x-appwrite-project' => $projectId,
|
'x-appwrite-project' => $projectId,
|
||||||
], $this->getHeaders()), $gqlPayload);
|
], $this->getHeaders()), $gqlPayload);
|
||||||
|
|
||||||
|
$this->assertIsNotArray($document['body']);
|
||||||
$this->assertEquals(204, $document['headers']['status-code']);
|
$this->assertEquals(204, $document['headers']['status-code']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -871,6 +872,7 @@ class GraphQLDatabaseServerTest extends Scope
|
||||||
'x-appwrite-project' => $projectId,
|
'x-appwrite-project' => $projectId,
|
||||||
], $this->getHeaders()), $gqlPayload);
|
], $this->getHeaders()), $gqlPayload);
|
||||||
|
|
||||||
|
$this->assertIsNotArray($attribute['body']);
|
||||||
$this->assertEquals(204, $attribute['headers']['status-code']);
|
$this->assertEquals(204, $attribute['headers']['status-code']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -895,6 +897,7 @@ class GraphQLDatabaseServerTest extends Scope
|
||||||
'x-appwrite-project' => $projectId,
|
'x-appwrite-project' => $projectId,
|
||||||
], $this->getHeaders()), $gqlPayload);
|
], $this->getHeaders()), $gqlPayload);
|
||||||
|
|
||||||
|
$this->assertIsNotArray($collection['body']);
|
||||||
$this->assertEquals(204, $collection['headers']['status-code']);
|
$this->assertEquals(204, $collection['headers']['status-code']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -918,6 +921,7 @@ class GraphQLDatabaseServerTest extends Scope
|
||||||
'x-appwrite-project' => $projectId,
|
'x-appwrite-project' => $projectId,
|
||||||
], $this->getHeaders()), $gqlPayload);
|
], $this->getHeaders()), $gqlPayload);
|
||||||
|
|
||||||
|
$this->assertIsNotArray($database['body']);
|
||||||
$this->assertEquals(204, $database['headers']['status-code']);
|
$this->assertEquals(204, $database['headers']['status-code']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -400,6 +400,7 @@ class GraphQLFunctionsServerTest extends Scope
|
||||||
'x-appwrite-project' => $projectId,
|
'x-appwrite-project' => $projectId,
|
||||||
], $this->getHeaders()), $gqlPayload);
|
], $this->getHeaders()), $gqlPayload);
|
||||||
|
|
||||||
|
$this->assertIsNotArray($response['body']);
|
||||||
$this->assertEquals(204, $response['headers']['status-code']);
|
$this->assertEquals(204, $response['headers']['status-code']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -425,6 +426,7 @@ class GraphQLFunctionsServerTest extends Scope
|
||||||
'x-appwrite-project' => $projectId,
|
'x-appwrite-project' => $projectId,
|
||||||
], $this->getHeaders()), $gqlPayload);
|
], $this->getHeaders()), $gqlPayload);
|
||||||
|
|
||||||
|
$this->assertIsNotArray($response['body']);
|
||||||
$this->assertEquals(204, $response['headers']['status-code']);
|
$this->assertEquals(204, $response['headers']['status-code']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -258,7 +258,6 @@ class GraphQLStorageClientTest extends Scope
|
||||||
/**
|
/**
|
||||||
* @depends testCreateFile
|
* @depends testCreateFile
|
||||||
* @param $file
|
* @param $file
|
||||||
* @return array
|
|
||||||
* @throws \Exception
|
* @throws \Exception
|
||||||
*/
|
*/
|
||||||
public function testDeleteFile($file): void
|
public function testDeleteFile($file): void
|
||||||
|
@ -278,6 +277,7 @@ class GraphQLStorageClientTest extends Scope
|
||||||
'x-appwrite-project' => $projectId,
|
'x-appwrite-project' => $projectId,
|
||||||
], $this->getHeaders()), $gqlPayload);
|
], $this->getHeaders()), $gqlPayload);
|
||||||
|
|
||||||
$this->assertEquals(200, $file['headers']['status-code']);
|
$this->assertIsNotArray($file['body']);
|
||||||
|
$this->assertEquals(204, $file['headers']['status-code']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -358,7 +358,8 @@ class GraphQLStorageServerTest extends Scope
|
||||||
'x-appwrite-project' => $projectId,
|
'x-appwrite-project' => $projectId,
|
||||||
], $this->getHeaders()), $gqlPayload);
|
], $this->getHeaders()), $gqlPayload);
|
||||||
|
|
||||||
$this->assertEquals(200, $file['headers']['status-code']);
|
$this->assertIsNotArray($file['body']);
|
||||||
|
$this->assertEquals(204, $file['headers']['status-code']);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -383,6 +384,7 @@ class GraphQLStorageServerTest extends Scope
|
||||||
'x-appwrite-project' => $projectId,
|
'x-appwrite-project' => $projectId,
|
||||||
], $this->getHeaders()), $gqlPayload);
|
], $this->getHeaders()), $gqlPayload);
|
||||||
|
|
||||||
|
$this->assertIsNotArray($bucket['body']);
|
||||||
$this->assertEquals(204, $bucket['headers']['status-code']);
|
$this->assertEquals(204, $bucket['headers']['status-code']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -183,6 +183,7 @@ class GraphQLTeamsClientTest extends Scope
|
||||||
'x-appwrite-project' => $projectId,
|
'x-appwrite-project' => $projectId,
|
||||||
], $this->getHeaders()), $graphQLPayload);
|
], $this->getHeaders()), $graphQLPayload);
|
||||||
|
|
||||||
$this->assertEquals(200, $team['headers']['status-code']);
|
$this->assertIsNotArray($team['body']);
|
||||||
|
$this->assertEquals(204, $team['headers']['status-code']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -236,7 +236,8 @@ class GraphQLTeamsServerTest extends Scope
|
||||||
'x-appwrite-project' => $projectId,
|
'x-appwrite-project' => $projectId,
|
||||||
], $this->getHeaders()), $graphQLPayload);
|
], $this->getHeaders()), $graphQLPayload);
|
||||||
|
|
||||||
$this->assertEquals(200, $team['headers']['status-code']);
|
$this->assertIsNotArray($team['body']);
|
||||||
|
$this->assertEquals(204, $team['headers']['status-code']);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testDeleteTeam()
|
public function testDeleteTeam()
|
||||||
|
@ -257,6 +258,7 @@ class GraphQLTeamsServerTest extends Scope
|
||||||
'x-appwrite-project' => $projectId,
|
'x-appwrite-project' => $projectId,
|
||||||
], $this->getHeaders()), $graphQLPayload);
|
], $this->getHeaders()), $graphQLPayload);
|
||||||
|
|
||||||
$this->assertEquals(200, $team['headers']['status-code']);
|
$this->assertIsNotArray($team['body']);
|
||||||
|
$this->assertEquals(204, $team['headers']['status-code']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -372,6 +372,7 @@ class GraphQLUsersTest extends Scope
|
||||||
'x-appwrite-project' => $projectId,
|
'x-appwrite-project' => $projectId,
|
||||||
], $this->getHeaders()), $graphQLPayload);
|
], $this->getHeaders()), $graphQLPayload);
|
||||||
|
|
||||||
|
$this->assertIsNotArray($user['body']);
|
||||||
$this->assertEquals(204, $user['headers']['status-code']);
|
$this->assertEquals(204, $user['headers']['status-code']);
|
||||||
|
|
||||||
unset(self::$user[$this->getProject()['$id']]);
|
unset(self::$user[$this->getProject()['$id']]);
|
||||||
|
@ -395,6 +396,7 @@ class GraphQLUsersTest extends Scope
|
||||||
'x-appwrite-project' => $projectId,
|
'x-appwrite-project' => $projectId,
|
||||||
], $this->getHeaders()), $graphQLPayload);
|
], $this->getHeaders()), $graphQLPayload);
|
||||||
|
|
||||||
|
$this->assertIsNotArray($user['body']);
|
||||||
$this->assertEquals(204, $user['headers']['status-code']);
|
$this->assertEquals(204, $user['headers']['status-code']);
|
||||||
|
|
||||||
unset(self::$user[$this->getProject()['$id']]);
|
unset(self::$user[$this->getProject()['$id']]);
|
||||||
|
@ -417,6 +419,7 @@ class GraphQLUsersTest extends Scope
|
||||||
'x-appwrite-project' => $projectId,
|
'x-appwrite-project' => $projectId,
|
||||||
], $this->getHeaders()), $graphQLPayload);
|
], $this->getHeaders()), $graphQLPayload);
|
||||||
|
|
||||||
|
$this->assertIsNotArray($user['body']);
|
||||||
$this->assertEquals(204, $user['headers']['status-code']);
|
$this->assertEquals(204, $user['headers']['status-code']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue