Manual code review suggestion changes
This commit is contained in:
parent
1f2f0c2443
commit
c61b00995c
|
@ -77,6 +77,10 @@ class FunctionsCustomServerTest extends Scope
|
|||
/**
|
||||
* Test for SUCCESS
|
||||
*/
|
||||
|
||||
/**
|
||||
* Test search queries
|
||||
*/
|
||||
$response = $this->client->call(Client::METHOD_GET, '/functions', array_merge([
|
||||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
|
@ -110,7 +114,9 @@ class FunctionsCustomServerTest extends Scope
|
|||
$this->assertCount(1, $response['body']['functions']);
|
||||
$this->assertEquals($response['body']['functions'][0]['$id'], $data['functionId']);
|
||||
|
||||
|
||||
/**
|
||||
* Test pagination
|
||||
*/
|
||||
$response = $this->client->call(Client::METHOD_POST, '/functions', array_merge([
|
||||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
|
@ -155,7 +161,6 @@ class FunctionsCustomServerTest extends Scope
|
|||
$this->assertCount(1, $response['body']['functions']);
|
||||
$this->assertEquals($response['body']['functions'][0]['name'], 'Test 2');
|
||||
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
@ -316,6 +321,9 @@ class FunctionsCustomServerTest extends Scope
|
|||
$this->assertIsArray($function['body']['tags']);
|
||||
$this->assertCount(1, $function['body']['tags']);
|
||||
|
||||
/**
|
||||
* Test search queries
|
||||
*/
|
||||
$function = $this->client->call(Client::METHOD_GET, '/functions/'.$data['functionId'].'/tags', array_merge([
|
||||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
|
|
|
@ -87,6 +87,7 @@ class ProjectsConsoleClientTest extends Scope
|
|||
/**
|
||||
* Test for SUCCESS
|
||||
*/
|
||||
|
||||
$response = $this->client->call(Client::METHOD_GET, '/projects', array_merge([
|
||||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
|
@ -97,6 +98,9 @@ class ProjectsConsoleClientTest extends Scope
|
|||
$this->assertEquals($id, $response['body']['projects'][0]['$id']);
|
||||
$this->assertEquals('Project Test', $response['body']['projects'][0]['name']);
|
||||
|
||||
/**
|
||||
* Test search queries
|
||||
*/
|
||||
$response = $this->client->call(Client::METHOD_GET, '/projects', array_merge([
|
||||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
|
@ -104,9 +108,11 @@ class ProjectsConsoleClientTest extends Scope
|
|||
'search' => $id
|
||||
]));
|
||||
|
||||
$this->assertEquals(200, $response['headers']['status-code']);
|
||||
$this->assertNotEmpty($response['body']);
|
||||
$this->assertEquals('Project Test', $response['body']['projects'][0]['name']);
|
||||
$this->assertEquals($response['headers']['status-code'], 200);
|
||||
$this->assertEquals($response['body']['sum'], 1);
|
||||
$this->assertIsArray($response['body']['projects']);
|
||||
$this->assertCount(1, $response['body']['projects']);
|
||||
$this->assertEquals($response['body']['projects'][0]['name'], 'Project Test');
|
||||
|
||||
$response = $this->client->call(Client::METHOD_GET, '/projects', array_merge([
|
||||
'content-type' => 'application/json',
|
||||
|
@ -115,9 +121,11 @@ class ProjectsConsoleClientTest extends Scope
|
|||
'search' => 'Project Test'
|
||||
]));
|
||||
|
||||
$this->assertEquals(200, $response['headers']['status-code']);
|
||||
$this->assertNotEmpty($response['body']);
|
||||
$this->assertEquals($id, $response['body']['projects'][0]['$id']);
|
||||
$this->assertEquals($response['headers']['status-code'], 200);
|
||||
$this->assertEquals($response['body']['sum'], 1);
|
||||
$this->assertIsArray($response['body']['projects']);
|
||||
$this->assertCount(1, $response['body']['projects']);
|
||||
$this->assertEquals($response['body']['projects'][0]['$id'], $data['projectId']);
|
||||
|
||||
/**
|
||||
* Test after pagination
|
||||
|
|
|
@ -132,7 +132,7 @@ trait UsersBase
|
|||
$this->assertEquals($response['headers']['status-code'], 200);
|
||||
$this->assertNotEmpty($response['body']);
|
||||
$this->assertNotEmpty($response['body']['users']);
|
||||
$this->assertGreaterThan(0, $response['body']['users']);
|
||||
$this->assertCount(1, $response['body']['users']);
|
||||
$this->assertEquals($response['body']['users'][0]['$id'], $data['userId']);
|
||||
|
||||
$response = $this->client->call(Client::METHOD_GET, '/users', array_merge([
|
||||
|
@ -144,7 +144,7 @@ trait UsersBase
|
|||
$this->assertEquals($response['headers']['status-code'], 200);
|
||||
$this->assertNotEmpty($response['body']);
|
||||
$this->assertNotEmpty($response['body']['users']);
|
||||
$this->assertGreaterThan(0, $response['body']['users']);
|
||||
$this->assertCount(1, $response['body']['users']);
|
||||
$this->assertEquals($response['body']['users'][0]['$id'], $data['userId']);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue