1
0
Fork 0
mirror of synced 2024-06-02 10:54:44 +12:00

fix tests for database

This commit is contained in:
Damodar Lohani 2021-07-19 15:11:00 +05:45
parent d8dc30b08a
commit 6aa5bb42b6
2 changed files with 11 additions and 0 deletions

View file

@ -16,6 +16,7 @@ trait DatabaseBase
'x-appwrite-project' => $this->getProject()['$id'],
'x-appwrite-key' => $this->getProject()['apiKey']
]), [
'collectionId' => 'unique()',
'name' => 'Movies',
'read' => ['role:all'],
'write' => ['role:all'],
@ -160,6 +161,7 @@ trait DatabaseBase
'content-type' => 'application/json',
'x-appwrite-project' => $this->getProject()['$id'],
], $this->getHeaders()), [
'documentId' => 'unique()',
'data' => [
'title' => 'Captain America',
'releaseYear' => 1944,
@ -176,6 +178,7 @@ trait DatabaseBase
'content-type' => 'application/json',
'x-appwrite-project' => $this->getProject()['$id'],
], $this->getHeaders()), [
'documentId' => 'unique()',
'data' => [
'title' => 'Spider-Man: Far From Home',
'releaseYear' => 2019,
@ -193,6 +196,7 @@ trait DatabaseBase
'content-type' => 'application/json',
'x-appwrite-project' => $this->getProject()['$id'],
], $this->getHeaders()), [
'documentId' => 'unique()',
'data' => [
'title' => 'Spider-Man: Homecoming',
'releaseYear' => 2017,
@ -209,6 +213,7 @@ trait DatabaseBase
'content-type' => 'application/json',
'x-appwrite-project' => $this->getProject()['$id'],
], $this->getHeaders()), [
'documentId' => 'unique()',
'data' => [
'releaseYear' => 2020, // Missing title, expect an 400 error
],
@ -421,6 +426,7 @@ trait DatabaseBase
'content-type' => 'application/json',
'x-appwrite-project' => $this->getProject()['$id'],
], $this->getHeaders()), [
'documentId' => 'unique()',
'data' => [
'title' => 'Thor: Ragnaroc',
'releaseYear' => 2017,
@ -476,6 +482,7 @@ trait DatabaseBase
'content-type' => 'application/json',
'x-appwrite-project' => $this->getProject()['$id'],
], $this->getHeaders()), [
'documentId' => 'unique()',
'data' => [
'title' => 'Thor: Ragnarok',
'releaseYear' => 2017,
@ -523,6 +530,7 @@ trait DatabaseBase
'content-type' => 'application/json',
'x-appwrite-project' => $this->getProject()['$id'],
], $this->getHeaders()), [
'documentId' => 'unique()',
'data' => [
'title' => 'Captain America',
'releaseYear' => 1944,

View file

@ -25,6 +25,7 @@ class DatabaseCustomServerTest extends Scope
'x-appwrite-project' => $this->getProject()['$id'],
'x-appwrite-key' => $this->getProject()['apiKey']
]), [
'collectionId' => 'unique()',
'name' => 'Actors',
'read' => ['role:all'],
'write' => ['role:all'],
@ -76,6 +77,7 @@ class DatabaseCustomServerTest extends Scope
'content-type' => 'application/json',
'x-appwrite-project' => $this->getProject()['$id'],
], $this->getHeaders()), [
'documentId' => 'unique()',
'data' => [
'firstName' => 'Tom',
'lastName' => 'Holland',
@ -88,6 +90,7 @@ class DatabaseCustomServerTest extends Scope
'content-type' => 'application/json',
'x-appwrite-project' => $this->getProject()['$id'],
], $this->getHeaders()), [
'documentId' => 'unique()',
'data' => [
'firstName' => 'Samuel',
'lastName' => 'Jackson',