From ef3adf469e7795123f280d0bbd672cef4026f663 Mon Sep 17 00:00:00 2001 From: fogelito Date: Mon, 30 Oct 2023 17:04:22 +0200 Subject: [PATCH] Reproduce steps --- phpunit.xml | 2 +- tests/e2e/Services/Databases/DatabasesBase.php | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/phpunit.xml b/phpunit.xml index 975b54962a..99ccaf1755 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -6,7 +6,7 @@ convertNoticesToExceptions="true" convertWarningsToExceptions="true" processIsolation="false" - stopOnFailure="false" + stopOnFailure="true" > diff --git a/tests/e2e/Services/Databases/DatabasesBase.php b/tests/e2e/Services/Databases/DatabasesBase.php index 34a433353c..be6c3886b5 100644 --- a/tests/e2e/Services/Databases/DatabasesBase.php +++ b/tests/e2e/Services/Databases/DatabasesBase.php @@ -1945,6 +1945,22 @@ trait DatabasesBase $this->assertEquals(200, $document['headers']['status-code']); + // Delete for the first time + $document = $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId . '/collections/' . $data['moviesId'] . '/documents/' . $id, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + for ($i = 0 ; $i < 10000 ; $i++){ + $document = $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId . '/collections/' . $data['moviesId'] . '/documents/' . $id, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals('Document with the requested ID could not be found.', $document['body']['message']); + $this->assertEquals(404, $document['body']['code']); + } + $document = $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId . '/collections/' . $data['moviesId'] . '/documents/' . $id, array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'],