1
0
Fork 0
mirror of synced 2024-07-02 21:20:58 +12:00

Test fixes

This commit is contained in:
Jake Barnby 2022-07-18 21:38:13 +12:00
parent f37bddbc6d
commit e3bed0c636
14 changed files with 30 additions and 13 deletions

View file

@ -838,7 +838,7 @@ return [
'variables' => [
[
'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',
'default' => '10',
'required' => false,
@ -847,7 +847,7 @@ return [
],
[
'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',
'default' => '50',
'required' => false,

View file

@ -70,7 +70,7 @@ App::post('/v1/teams')
if (!\in_array('owner', $roles)) {
$roles[] = 'owner';
}
$membershipId = $dbForProject->getId();
$membership = new Document([
'$id' => $membershipId,

View file

@ -32,7 +32,7 @@ class Resolvers
$path = $route->getPath();
foreach ($args as $key => $value) {
if (\str_contains($path, $key)) {
if (\str_contains($path, '/:' . $key)) {
$path = \str_replace(':' . $key, $value, $path);
}
}

View file

@ -444,8 +444,8 @@ class GraphQLAccountTest extends Scope
'x-appwrite-project' => $projectId,
], $this->getHeaders()), $graphQLPayload);
$this->assertIsNotArray($account['body']);
$this->assertEquals(204, $account['headers']['status-code']);
$this->assertEmpty($account['body']);
unset(self::$user[$this->getProject()['$id']]);
$this->getUser();
@ -469,6 +469,7 @@ class GraphQLAccountTest extends Scope
'x-appwrite-project' => $projectId,
], $this->getHeaders()), $graphQLPayload);
$this->assertIsNotArray($account['body']);
$this->assertEquals(204, $account['headers']['status-code']);
unset(self::$user[$this->getProject()['$id']]);

View file

@ -235,6 +235,7 @@ class GraphQLAuthTest extends Scope
'cookie' => 'a_session_' . $projectId . '=' . $this->token1,
], $gqlPayload);
$this->assertIsNotArray($document['body']);
$this->assertEquals(204, $document['headers']['status-code']);
}
}

View file

@ -1057,8 +1057,8 @@ trait GraphQLBase
}
}';
case self::$DELETE_TEAM_MEMBERSHIP:
return 'mutation deleteTeamMembership($teamId: String!, $userId: String!){
teamsDeleteMembership(teamId: $teamId, userId: $userId)
return 'mutation deleteTeamMembership($teamId: String!, $membershipId: String!){
teamsDeleteMembership(teamId: $teamId, membershipId: $membershipId)
}';
case self::$GET_FUNCTION:
return 'query getFunction($functionId: String!) {

View file

@ -288,6 +288,7 @@ class GraphQLDatabaseClientTest extends Scope
'x-appwrite-project' => $projectId,
], $this->getHeaders()), $gqlPayload);
$this->assertIsNotArray($document['body']);
$this->assertEquals(204, $document['headers']['status-code']);
}
}

View file

@ -843,6 +843,7 @@ class GraphQLDatabaseServerTest extends Scope
'x-appwrite-project' => $projectId,
], $this->getHeaders()), $gqlPayload);
$this->assertIsNotArray($document['body']);
$this->assertEquals(204, $document['headers']['status-code']);
}
@ -871,6 +872,7 @@ class GraphQLDatabaseServerTest extends Scope
'x-appwrite-project' => $projectId,
], $this->getHeaders()), $gqlPayload);
$this->assertIsNotArray($attribute['body']);
$this->assertEquals(204, $attribute['headers']['status-code']);
}
@ -895,6 +897,7 @@ class GraphQLDatabaseServerTest extends Scope
'x-appwrite-project' => $projectId,
], $this->getHeaders()), $gqlPayload);
$this->assertIsNotArray($collection['body']);
$this->assertEquals(204, $collection['headers']['status-code']);
}
@ -918,6 +921,7 @@ class GraphQLDatabaseServerTest extends Scope
'x-appwrite-project' => $projectId,
], $this->getHeaders()), $gqlPayload);
$this->assertIsNotArray($database['body']);
$this->assertEquals(204, $database['headers']['status-code']);
}
}

View file

@ -400,6 +400,7 @@ class GraphQLFunctionsServerTest extends Scope
'x-appwrite-project' => $projectId,
], $this->getHeaders()), $gqlPayload);
$this->assertIsNotArray($response['body']);
$this->assertEquals(204, $response['headers']['status-code']);
}
@ -425,6 +426,7 @@ class GraphQLFunctionsServerTest extends Scope
'x-appwrite-project' => $projectId,
], $this->getHeaders()), $gqlPayload);
$this->assertIsNotArray($response['body']);
$this->assertEquals(204, $response['headers']['status-code']);
}
}

View file

@ -258,7 +258,6 @@ class GraphQLStorageClientTest extends Scope
/**
* @depends testCreateFile
* @param $file
* @return array
* @throws \Exception
*/
public function testDeleteFile($file): void
@ -278,6 +277,7 @@ class GraphQLStorageClientTest extends Scope
'x-appwrite-project' => $projectId,
], $this->getHeaders()), $gqlPayload);
$this->assertEquals(200, $file['headers']['status-code']);
$this->assertIsNotArray($file['body']);
$this->assertEquals(204, $file['headers']['status-code']);
}
}

View file

@ -358,7 +358,8 @@ class GraphQLStorageServerTest extends Scope
'x-appwrite-project' => $projectId,
], $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,
], $this->getHeaders()), $gqlPayload);
$this->assertIsNotArray($bucket['body']);
$this->assertEquals(204, $bucket['headers']['status-code']);
}
}

View file

@ -183,6 +183,7 @@ class GraphQLTeamsClientTest extends Scope
'x-appwrite-project' => $projectId,
], $this->getHeaders()), $graphQLPayload);
$this->assertEquals(200, $team['headers']['status-code']);
$this->assertIsNotArray($team['body']);
$this->assertEquals(204, $team['headers']['status-code']);
}
}

View file

@ -236,7 +236,8 @@ class GraphQLTeamsServerTest extends Scope
'x-appwrite-project' => $projectId,
], $this->getHeaders()), $graphQLPayload);
$this->assertEquals(200, $team['headers']['status-code']);
$this->assertIsNotArray($team['body']);
$this->assertEquals(204, $team['headers']['status-code']);
}
public function testDeleteTeam()
@ -257,6 +258,7 @@ class GraphQLTeamsServerTest extends Scope
'x-appwrite-project' => $projectId,
], $this->getHeaders()), $graphQLPayload);
$this->assertEquals(200, $team['headers']['status-code']);
$this->assertIsNotArray($team['body']);
$this->assertEquals(204, $team['headers']['status-code']);
}
}

View file

@ -372,6 +372,7 @@ class GraphQLUsersTest extends Scope
'x-appwrite-project' => $projectId,
], $this->getHeaders()), $graphQLPayload);
$this->assertIsNotArray($user['body']);
$this->assertEquals(204, $user['headers']['status-code']);
unset(self::$user[$this->getProject()['$id']]);
@ -395,6 +396,7 @@ class GraphQLUsersTest extends Scope
'x-appwrite-project' => $projectId,
], $this->getHeaders()), $graphQLPayload);
$this->assertIsNotArray($user['body']);
$this->assertEquals(204, $user['headers']['status-code']);
unset(self::$user[$this->getProject()['$id']]);
@ -417,6 +419,7 @@ class GraphQLUsersTest extends Scope
'x-appwrite-project' => $projectId,
], $this->getHeaders()), $graphQLPayload);
$this->assertIsNotArray($user['body']);
$this->assertEquals(204, $user['headers']['status-code']);
}
}