Adjust tests for new attribute routes
This commit is contained in:
parent
97b7c863a8
commit
92175c5e32
|
@ -32,35 +32,32 @@ trait DatabaseBase
|
|||
*/
|
||||
public function testCreateAttributes(array $data): array
|
||||
{
|
||||
$title = $this->client->call(Client::METHOD_POST, '/database/collections/' . $data['moviesId'] . '/attributes', array_merge([
|
||||
$title = $this->client->call(Client::METHOD_POST, '/database/collections/' . $data['moviesId'] . '/attributes/string', array_merge([
|
||||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
'x-appwrite-key' => $this->getProject()['apiKey']
|
||||
]), [
|
||||
'id' => 'title',
|
||||
'type' => 'string',
|
||||
'attributeId' => 'title',
|
||||
'size' => 256,
|
||||
'required' => true,
|
||||
]);
|
||||
|
||||
$releaseYear = $this->client->call(Client::METHOD_POST, '/database/collections/' . $data['moviesId'] . '/attributes', array_merge([
|
||||
$releaseYear = $this->client->call(Client::METHOD_POST, '/database/collections/' . $data['moviesId'] . '/attributes/integer', array_merge([
|
||||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
'x-appwrite-key' => $this->getProject()['apiKey']
|
||||
]), [
|
||||
'id' => 'releaseYear',
|
||||
'type' => 'integer',
|
||||
'attributeId' => 'releaseYear',
|
||||
'size' => 0,
|
||||
'required' => true,
|
||||
]);
|
||||
|
||||
$actors = $this->client->call(Client::METHOD_POST, '/database/collections/' . $data['moviesId'] . '/attributes', array_merge([
|
||||
$actors = $this->client->call(Client::METHOD_POST, '/database/collections/' . $data['moviesId'] . '/attributes/string', array_merge([
|
||||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
'x-appwrite-key' => $this->getProject()['apiKey']
|
||||
]), [
|
||||
'id' => 'actors',
|
||||
'type' => 'string',
|
||||
'attributeId' => 'actors',
|
||||
'size' => 256,
|
||||
'required' => false,
|
||||
'default' => null,
|
||||
|
|
|
@ -33,24 +33,22 @@ class DatabaseCustomServerTest extends Scope
|
|||
$this->assertEquals($actors['headers']['status-code'], 201);
|
||||
$this->assertEquals($actors['body']['name'], 'Actors');
|
||||
|
||||
$firstName = $this->client->call(Client::METHOD_POST, '/database/collections/' . $actors['body']['$id'] . '/attributes', array_merge([
|
||||
$firstName = $this->client->call(Client::METHOD_POST, '/database/collections/' . $actors['body']['$id'] . '/attributes/string', array_merge([
|
||||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
'x-appwrite-key' => $this->getProject()['apiKey']
|
||||
]), [
|
||||
'id' => 'firstName',
|
||||
'type' => 'string',
|
||||
'attributeId' => 'firstName',
|
||||
'size' => 256,
|
||||
'required' => true,
|
||||
]);
|
||||
|
||||
$lastName = $this->client->call(Client::METHOD_POST, '/database/collections/' . $actors['body']['$id'] . '/attributes', array_merge([
|
||||
$lastName = $this->client->call(Client::METHOD_POST, '/database/collections/' . $actors['body']['$id'] . '/attributes/string', array_merge([
|
||||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
'x-appwrite-key' => $this->getProject()['apiKey']
|
||||
]), [
|
||||
'id' => 'lastName',
|
||||
'type' => 'string',
|
||||
'attributeId' => 'lastName',
|
||||
'size' => 256,
|
||||
'required' => true,
|
||||
]);
|
||||
|
|
|
@ -50,24 +50,22 @@ trait WebhooksBase
|
|||
*/
|
||||
public function testCreateAttributes(array $data): array
|
||||
{
|
||||
$firstName = $this->client->call(Client::METHOD_POST, '/database/collections/' . $data['actorsId'] . '/attributes', array_merge([
|
||||
$firstName = $this->client->call(Client::METHOD_POST, '/database/collections/' . $data['actorsId'] . '/attributes/string', array_merge([
|
||||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
'x-appwrite-key' => $this->getProject()['apiKey']
|
||||
]), [
|
||||
'id' => 'firstName',
|
||||
'type' => 'string',
|
||||
'attributeId' => 'firstName',
|
||||
'size' => 256,
|
||||
'required' => true,
|
||||
]);
|
||||
|
||||
$lastName = $this->client->call(Client::METHOD_POST, '/database/collections/' . $data['actorsId'] . '/attributes', array_merge([
|
||||
$lastName = $this->client->call(Client::METHOD_POST, '/database/collections/' . $data['actorsId'] . '/attributes/string', array_merge([
|
||||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
'x-appwrite-key' => $this->getProject()['apiKey']
|
||||
]), [
|
||||
'id' => 'lastName',
|
||||
'type' => 'string',
|
||||
'attributeId' => 'lastName',
|
||||
'size' => 256,
|
||||
'required' => true,
|
||||
]);
|
||||
|
|
Loading…
Reference in a new issue