tests adjustments
This commit is contained in:
parent
3954137382
commit
44af531881
4 changed files with 66 additions and 97 deletions
|
@ -56,47 +56,39 @@ class DatabasesConsoleClientTest extends Scope
|
||||||
/**
|
/**
|
||||||
* @depends testCreateCollection
|
* @depends testCreateCollection
|
||||||
*/
|
*/
|
||||||
// public function testGetDatabaseUsage(array $data)
|
public function testGetDatabaseUsage(array $data)
|
||||||
// {
|
{
|
||||||
// $databaseId = $data['databaseId'];
|
$databaseId = $data['databaseId'];
|
||||||
// /**
|
/**
|
||||||
// * Test for FAILURE
|
* Test for FAILURE
|
||||||
// */
|
*/
|
||||||
|
|
||||||
// $response = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/usage', array_merge([
|
$response = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/usage', array_merge([
|
||||||
// 'content-type' => 'application/json',
|
'content-type' => 'application/json',
|
||||||
// 'x-appwrite-project' => $this->getProject()['$id']
|
'x-appwrite-project' => $this->getProject()['$id']
|
||||||
// ], $this->getHeaders()), [
|
], $this->getHeaders()), [
|
||||||
// 'range' => '32h'
|
'range' => '32h'
|
||||||
// ]);
|
]);
|
||||||
|
|
||||||
// $this->assertEquals(400, $response['headers']['status-code']);
|
$this->assertEquals(400, $response['headers']['status-code']);
|
||||||
|
|
||||||
// /**
|
/**
|
||||||
// * Test for SUCCESS
|
* Test for SUCCESS
|
||||||
// */
|
*/
|
||||||
|
|
||||||
// $response = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/usage', array_merge([
|
$response = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/usage', array_merge([
|
||||||
// 'content-type' => 'application/json',
|
'content-type' => 'application/json',
|
||||||
// 'x-appwrite-project' => $this->getProject()['$id']
|
'x-appwrite-project' => $this->getProject()['$id']
|
||||||
// ], $this->getHeaders()), [
|
], $this->getHeaders()), [
|
||||||
// 'range' => '24h'
|
'range' => '24h'
|
||||||
// ]);
|
]);
|
||||||
|
|
||||||
// $this->assertEquals(200, $response['headers']['status-code']);
|
$this->assertEquals(200, $response['headers']['status-code']);
|
||||||
// $this->assertEquals(count($response['body']), 11);
|
$this->assertEquals(count($response['body']), 3);
|
||||||
// $this->assertEquals($response['body']['range'], '24h');
|
$this->assertEquals($response['body']['range'], '24h');
|
||||||
// $this->assertIsArray($response['body']['documentsCount']);
|
$this->assertIsArray($response['body']['documentsCount']);
|
||||||
// $this->assertIsArray($response['body']['collectionsCount']);
|
$this->assertIsArray($response['body']['collectionsCount']);
|
||||||
// $this->assertIsArray($response['body']['documentsCreate']);
|
}
|
||||||
// $this->assertIsArray($response['body']['documentsRead']);
|
|
||||||
// $this->assertIsArray($response['body']['documentsUpdate']);
|
|
||||||
// $this->assertIsArray($response['body']['documentsDelete']);
|
|
||||||
// $this->assertIsArray($response['body']['collectionsCreate']);
|
|
||||||
// $this->assertIsArray($response['body']['collectionsRead']);
|
|
||||||
// $this->assertIsArray($response['body']['collectionsUpdate']);
|
|
||||||
// $this->assertIsArray($response['body']['collectionsDelete']);
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -136,15 +128,10 @@ class DatabasesConsoleClientTest extends Scope
|
||||||
], $this->getHeaders()), [
|
], $this->getHeaders()), [
|
||||||
'range' => '24h'
|
'range' => '24h'
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$this->assertEquals(200, $response['headers']['status-code']);
|
$this->assertEquals(200, $response['headers']['status-code']);
|
||||||
$this->assertEquals(count($response['body']), 6);
|
$this->assertEquals(count($response['body']), 2);
|
||||||
$this->assertEquals($response['body']['range'], '24h');
|
$this->assertEquals($response['body']['range'], '24h');
|
||||||
$this->assertIsArray($response['body']['documentsCount']);
|
$this->assertIsArray($response['body']['documentsCount']);
|
||||||
$this->assertIsArray($response['body']['documentsCreate']);
|
|
||||||
$this->assertIsArray($response['body']['documentsRead']);
|
|
||||||
$this->assertIsArray($response['body']['documentsUpdate']);
|
|
||||||
$this->assertIsArray($response['body']['documentsDelete']);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -90,16 +90,15 @@ class FunctionsConsoleClientTest extends Scope
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$this->assertEquals($response['headers']['status-code'], 200);
|
$this->assertEquals($response['headers']['status-code'], 200);
|
||||||
$this->assertEquals(count($response['body']), 9);
|
$this->assertEquals(count($response['body']), 8);
|
||||||
$this->assertEquals($response['body']['range'], '24h');
|
$this->assertEquals($response['body']['range'], '24h');
|
||||||
$this->assertIsArray($response['body']['executionsTotal']);
|
$this->assertIsArray($response['body']['deployments']);
|
||||||
$this->assertIsArray($response['body']['executionsFailure']);
|
$this->assertIsArray($response['body']['deploymentsStorage']);
|
||||||
$this->assertIsArray($response['body']['executionsSuccess']);
|
$this->assertIsArray($response['body']['builds']);
|
||||||
$this->assertIsArray($response['body']['executionsTime']);
|
$this->assertIsArray($response['body']['buildsStorage']);
|
||||||
$this->assertIsArray($response['body']['buildsTotal']);
|
$this->assertIsArray($response['body']['buildsCompute']);
|
||||||
$this->assertIsArray($response['body']['buildsFailure']);
|
$this->assertIsArray($response['body']['executions']);
|
||||||
$this->assertIsArray($response['body']['buildsSuccess']);
|
$this->assertIsArray($response['body']['executionsCompute']);
|
||||||
$this->assertIsArray($response['body']['buildsTime']);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -39,7 +39,7 @@ class StorageConsoleClientTest extends Scope
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$this->assertEquals($response['headers']['status-code'], 200);
|
$this->assertEquals($response['headers']['status-code'], 200);
|
||||||
$this->assertEquals(12, count($response['body']));
|
$this->assertEquals(3, count($response['body']));
|
||||||
$this->assertEquals($response['body']['range'], '24h');
|
$this->assertEquals($response['body']['range'], '24h');
|
||||||
$this->assertIsArray($response['body']['storage']);
|
$this->assertIsArray($response['body']['storage']);
|
||||||
$this->assertIsArray($response['body']['filesCount']);
|
$this->assertIsArray($response['body']['filesCount']);
|
||||||
|
@ -94,13 +94,9 @@ class StorageConsoleClientTest extends Scope
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$this->assertEquals($response['headers']['status-code'], 200);
|
$this->assertEquals($response['headers']['status-code'], 200);
|
||||||
$this->assertEquals(count($response['body']), 7);
|
$this->assertEquals(count($response['body']), 2);
|
||||||
$this->assertEquals($response['body']['range'], '24h');
|
$this->assertEquals($response['body']['range'], '24h');
|
||||||
$this->assertIsArray($response['body']['filesCount']);
|
$this->assertIsArray($response['body']['filesCount']);
|
||||||
$this->assertIsArray($response['body']['filesCreate']);
|
|
||||||
$this->assertIsArray($response['body']['filesRead']);
|
|
||||||
$this->assertIsArray($response['body']['filesUpdate']);
|
|
||||||
$this->assertIsArray($response['body']['filesDelete']);
|
|
||||||
$this->assertIsArray($response['body']['filesStorage']);
|
$this->assertIsArray($response['body']['filesStorage']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,43 +23,36 @@ class UsersConsoleClientTest extends Scope
|
||||||
'x-appwrite-project' => $this->getProject()['$id']
|
'x-appwrite-project' => $this->getProject()['$id']
|
||||||
], $this->getHeaders()), [
|
], $this->getHeaders()), [
|
||||||
'range' => '32h',
|
'range' => '32h',
|
||||||
'provider' => 'email'
|
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$this->assertEquals($response['headers']['status-code'], 400);
|
$this->assertEquals($response['headers']['status-code'], 400);
|
||||||
|
//
|
||||||
|
// $response = $this->client->call(Client::METHOD_GET, '/users/usage', array_merge([
|
||||||
|
// 'content-type' => 'application/json',
|
||||||
|
// 'x-appwrite-project' => $this->getProject()['$id']
|
||||||
|
// ], $this->getHeaders()), [
|
||||||
|
// 'range' => '24h',
|
||||||
|
// 'provider' => 'some-random-provider'
|
||||||
|
// ]);
|
||||||
|
//
|
||||||
|
// $this->assertEquals($response['headers']['status-code'], 400);
|
||||||
|
|
||||||
$response = $this->client->call(Client::METHOD_GET, '/users/usage', array_merge([
|
// /**
|
||||||
'content-type' => 'application/json',
|
// * Test for SUCCESS
|
||||||
'x-appwrite-project' => $this->getProject()['$id']
|
// */
|
||||||
], $this->getHeaders()), [
|
// $response = $this->client->call(Client::METHOD_GET, '/users/usage', array_merge([
|
||||||
'range' => '24h',
|
// 'content-type' => 'application/json',
|
||||||
'provider' => 'some-random-provider'
|
// 'x-appwrite-project' => $this->getProject()['$id']
|
||||||
]);
|
// ], $this->getHeaders()), [
|
||||||
|
// 'range' => '24h',
|
||||||
|
// ]);
|
||||||
|
//
|
||||||
|
// $this->assertEquals($response['headers']['status-code'], 200);
|
||||||
|
// $this->assertEquals(count($response['body']), 2);
|
||||||
|
// $this->assertEquals($response['body']['range'], '24h');
|
||||||
|
// $this->assertIsArray($response['body']['usersCount']);
|
||||||
|
// $this->assertIsArray($response['body']['sessionsCount']);
|
||||||
|
|
||||||
$this->assertEquals($response['headers']['status-code'], 400);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Test for SUCCESS
|
|
||||||
*/
|
|
||||||
$response = $this->client->call(Client::METHOD_GET, '/users/usage', array_merge([
|
|
||||||
'content-type' => 'application/json',
|
|
||||||
'x-appwrite-project' => $this->getProject()['$id']
|
|
||||||
], $this->getHeaders()), [
|
|
||||||
'range' => '24h',
|
|
||||||
'provider' => 'email'
|
|
||||||
]);
|
|
||||||
|
|
||||||
$this->assertEquals($response['headers']['status-code'], 200);
|
|
||||||
$this->assertEquals(count($response['body']), 9);
|
|
||||||
$this->assertEquals($response['body']['range'], '24h');
|
|
||||||
$this->assertIsArray($response['body']['usersCount']);
|
|
||||||
$this->assertIsArray($response['body']['usersCreate']);
|
|
||||||
$this->assertIsArray($response['body']['usersRead']);
|
|
||||||
$this->assertIsArray($response['body']['usersUpdate']);
|
|
||||||
$this->assertIsArray($response['body']['usersDelete']);
|
|
||||||
$this->assertIsArray($response['body']['sessionsCreate']);
|
|
||||||
$this->assertIsArray($response['body']['sessionsProviderCreate']);
|
|
||||||
$this->assertIsArray($response['body']['sessionsDelete']);
|
|
||||||
|
|
||||||
$response = $this->client->call(Client::METHOD_GET, '/users/usage', array_merge([
|
$response = $this->client->call(Client::METHOD_GET, '/users/usage', array_merge([
|
||||||
'content-type' => 'application/json',
|
'content-type' => 'application/json',
|
||||||
|
@ -69,15 +62,9 @@ class UsersConsoleClientTest extends Scope
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$this->assertEquals($response['headers']['status-code'], 200);
|
$this->assertEquals($response['headers']['status-code'], 200);
|
||||||
$this->assertEquals(count($response['body']), 9);
|
$this->assertEquals(count($response['body']), 2);
|
||||||
$this->assertEquals($response['body']['range'], '24h');
|
$this->assertEquals($response['body']['range'], '24h');
|
||||||
$this->assertIsArray($response['body']['usersCount']);
|
$this->assertIsArray($response['body']['usersCount']);
|
||||||
$this->assertIsArray($response['body']['usersCreate']);
|
$this->assertIsArray($response['body']['sessionsCount']);
|
||||||
$this->assertIsArray($response['body']['usersRead']);
|
|
||||||
$this->assertIsArray($response['body']['usersUpdate']);
|
|
||||||
$this->assertIsArray($response['body']['usersDelete']);
|
|
||||||
$this->assertIsArray($response['body']['sessionsCreate']);
|
|
||||||
$this->assertIsArray($response['body']['sessionsProviderCreate']);
|
|
||||||
$this->assertIsArray($response['body']['sessionsDelete']);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue