From 5cf4cbaf87a01cc983bae8b50009433b65bb760c Mon Sep 17 00:00:00 2001 From: Syndesi Date: Fri, 6 Oct 2023 21:51:29 +0200 Subject: [PATCH] Implement changes from #161, closes it. --- .env | 2 +- CHANGELOG.md | 1 + .../api-endpoints/user/get-me/200-response-body.json | 2 +- src/Command/DatabaseDropCommand.php | 1 - .../User/PostChangePasswordTest.php | 4 ++-- .../User/PostTokenTest.php | 2 +- .../Scenario01PostIndex/_E1_01_CreateNodeTest.php | 4 ++-- .../_E1_02_CreateRelationTest.php | 8 ++++---- .../Scenario03PutElement/_E3_01_PutNodeTest.php | 6 +++--- .../Scenario03PutElement/_E3_02_PutRelationTest.php | 6 +++--- .../Scenario04PatchElement/_E4_01_PatchNodeTest.php | 4 ++-- .../_E4_02_PatchRelationTest.php | 4 ++-- .../Endpoint/User/PostChangePasswordTest.php | 2 +- .../FeatureTests/Endpoint/User/PostRegisterTest.php | 12 ++++++------ tests/FeatureTests/Endpoint/User/PostTokenTest.php | 2 +- .../_02_01_ImmediateNodeOwnershipTest.php | 2 +- .../_07_01_SearchAccessTest.php | 2 +- 17 files changed, 32 insertions(+), 32 deletions(-) diff --git a/.env b/.env index acf11c76..5e98b218 100755 --- a/.env +++ b/.env @@ -28,4 +28,4 @@ ELASTIC_AUTH=ember-nexus-elasticsearch:9200 REDIS_AUTH=tcp://ember-nexus-redis?password=redis-password RABBITMQ_AUTH=amqp://user:password@ember-nexus-rabbitmq:5672 -REFERENCE_DATASET_VERSION=0.0.12 +REFERENCE_DATASET_VERSION=0.0.13 diff --git a/CHANGELOG.md b/CHANGELOG.md index b8403221..6050c813 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - Rename term "session" to "token", closes #145. - Finalise documentation for the POST /token endpoint, closes #49. +- Implement changes from #161, closes it. ## 0.0.32 - 2023-09-30 ### Added diff --git a/docs/api-endpoints/user/get-me/200-response-body.json b/docs/api-endpoints/user/get-me/200-response-body.json index 03dbe08f..0748ec57 100644 --- a/docs/api-endpoints/user/get-me/200-response-body.json +++ b/docs/api-endpoints/user/get-me/200-response-body.json @@ -8,6 +8,6 @@ "email": "anonymous-user@localhost.dev", "note": "User contains password only due to testing purposes.", "password": "1234", - "test": "general.anonymousUser" + "scenario": "general.anonymousUser" } } \ No newline at end of file diff --git a/src/Command/DatabaseDropCommand.php b/src/Command/DatabaseDropCommand.php index e48d9dba..02d966d6 100755 --- a/src/Command/DatabaseDropCommand.php +++ b/src/Command/DatabaseDropCommand.php @@ -109,7 +109,6 @@ private function deleteObjectStorage(): void { $this->io->startSection('Task 3 of 6: Object Storage'); $this->io->writeln('Deleting object storage data...'); - // todo $this->io->stopSection('Object storage is currently not implemented, nothing to delete.'); } diff --git a/tests/ExampleGenerationController/User/PostChangePasswordTest.php b/tests/ExampleGenerationController/User/PostChangePasswordTest.php index f79ab566..00a0967d 100644 --- a/tests/ExampleGenerationController/User/PostChangePasswordTest.php +++ b/tests/ExampleGenerationController/User/PostChangePasswordTest.php @@ -18,7 +18,7 @@ public function testChangePasswordSuccess(): void 'currentPassword' => '1234', 'newPassword' => 'abcd', 'data' => [ - 'email' => 'user@changePassword.user.endpoint.localhost.de', + 'email' => 'user@changePassword.user.endpoint.localhost.dev', ], ] ); @@ -41,7 +41,7 @@ public function testChangePasswordError400(): void 'currentPassword' => '1234', 'newPassword' => 'abcd', 'data' => [ - 'email' => 'user@changePassword.user.endpoint.localhost.de', + 'email' => 'user@changePassword.user.endpoint.localhost.dev', ], ] ); diff --git a/tests/ExampleGenerationController/User/PostTokenTest.php b/tests/ExampleGenerationController/User/PostTokenTest.php index 07f633a8..a911931d 100644 --- a/tests/ExampleGenerationController/User/PostTokenTest.php +++ b/tests/ExampleGenerationController/User/PostTokenTest.php @@ -6,7 +6,7 @@ class PostTokenTest extends BaseRequestTestCase { - public const EMAIL = 'user@postToken.user.endpoint.localhost.de'; + public const EMAIL = 'user@postToken.user.endpoint.localhost.dev'; public const PASSWORD = '1234'; private const PATH_TO_ROOT = __DIR__.'/../../../'; diff --git a/tests/FeatureTests/Endpoint/Scenario01PostIndex/_E1_01_CreateNodeTest.php b/tests/FeatureTests/Endpoint/Scenario01PostIndex/_E1_01_CreateNodeTest.php index 4f248077..2c360e5b 100644 --- a/tests/FeatureTests/Endpoint/Scenario01PostIndex/_E1_01_CreateNodeTest.php +++ b/tests/FeatureTests/Endpoint/Scenario01PostIndex/_E1_01_CreateNodeTest.php @@ -17,7 +17,7 @@ public function testCreateNode(): void 'type' => 'Data', 'data' => [ 'name' => 'some name', - 'test' => 'e1-01', + 'scenario' => 'e1-01', ], ] ); @@ -32,7 +32,7 @@ public function testCreateNodeWithoutType(): void [ 'data' => [ 'name' => 'some name', - 'test' => 'e1-01', + 'scenario' => 'e1-01', ], ] ); diff --git a/tests/FeatureTests/Endpoint/Scenario01PostIndex/_E1_02_CreateRelationTest.php b/tests/FeatureTests/Endpoint/Scenario01PostIndex/_E1_02_CreateRelationTest.php index 3f11abf7..0ccd1208 100644 --- a/tests/FeatureTests/Endpoint/Scenario01PostIndex/_E1_02_CreateRelationTest.php +++ b/tests/FeatureTests/Endpoint/Scenario01PostIndex/_E1_02_CreateRelationTest.php @@ -19,7 +19,7 @@ public function testCreateRelation(): void 'type' => 'RELATION', 'data' => [ 'name' => 'some name', - 'test' => 'e1-02', + 'scenario' => 'e1-02', ], 'start' => self::START, 'end' => self::END, @@ -36,7 +36,7 @@ public function testCreateRelationWithoutType(): void [ 'data' => [ 'name' => 'some name', - 'test' => 'e1-02', + 'scenario' => 'e1-02', ], 'start' => self::START, 'end' => self::END, @@ -54,7 +54,7 @@ public function testCreateRelationWithoutStart(): void 'type' => 'RELATION', 'data' => [ 'name' => 'some name', - 'test' => 'e1-02', + 'scenario' => 'e1-02', ], 'end' => self::END, ] @@ -71,7 +71,7 @@ public function testCreateRelationWithoutEnd(): void 'type' => 'RELATION', 'data' => [ 'name' => 'some name', - 'test' => 'e1-02', + 'scenario' => 'e1-02', ], 'start' => self::START, ] diff --git a/tests/FeatureTests/Endpoint/Scenario03PutElement/_E3_01_PutNodeTest.php b/tests/FeatureTests/Endpoint/Scenario03PutElement/_E3_01_PutNodeTest.php index 5bab2b1c..dc48fd96 100644 --- a/tests/FeatureTests/Endpoint/Scenario03PutElement/_E3_01_PutNodeTest.php +++ b/tests/FeatureTests/Endpoint/Scenario03PutElement/_E3_01_PutNodeTest.php @@ -14,7 +14,7 @@ public function testPutNode(): void $response = $this->runGetRequest(sprintf('/%s', self::DATA), self::TOKEN); $this->assertIsNodeResponse($response, 'Data'); $data = $this->getBody($response)['data']; - $this->assertArrayHasKey('test', $data); + $this->assertArrayHasKey('scenario', $data); $this->assertArrayHasKey('name', $data); $this->assertArrayHasKey('created', $data); $this->assertArrayHasKey('updated', $data); @@ -25,7 +25,7 @@ public function testPutNode(): void self::TOKEN, [ 'new-property' => 'new value', - 'test' => 'e3-01', + 'scenario' => 'e3-01', ] ); print_r((string) $response->getBody()); @@ -34,7 +34,7 @@ public function testPutNode(): void $response = $this->runGetRequest(sprintf('/%s', self::DATA), self::TOKEN); $this->assertIsNodeResponse($response, 'Data'); $data = $this->getBody($response)['data']; - $this->assertArrayHasKey('test', $data); + $this->assertArrayHasKey('scenario', $data); $this->assertArrayHasKey('created', $data); $this->assertArrayHasKey('new-property', $data); $this->assertArrayHasKey('updated', $data); diff --git a/tests/FeatureTests/Endpoint/Scenario03PutElement/_E3_02_PutRelationTest.php b/tests/FeatureTests/Endpoint/Scenario03PutElement/_E3_02_PutRelationTest.php index f57fac4d..65a34918 100644 --- a/tests/FeatureTests/Endpoint/Scenario03PutElement/_E3_02_PutRelationTest.php +++ b/tests/FeatureTests/Endpoint/Scenario03PutElement/_E3_02_PutRelationTest.php @@ -14,7 +14,7 @@ public function testPutRelation(): void $response = $this->runGetRequest(sprintf('/%s', self::RELATION), self::TOKEN); $this->assertIsRelationResponse($response, 'RELATION'); $data = $this->getBody($response)['data']; - $this->assertArrayHasKey('test', $data); + $this->assertArrayHasKey('scenario', $data); $this->assertArrayHasKey('name', $data); $this->assertArrayHasKey('created', $data); $this->assertArrayHasKey('updated', $data); @@ -25,7 +25,7 @@ public function testPutRelation(): void self::TOKEN, [ 'new-property' => 'new value', - 'test' => 'e3-02', + 'scenario' => 'e3-02', ] ); $this->assertNoContentResponse($response); @@ -33,7 +33,7 @@ public function testPutRelation(): void $response = $this->runGetRequest(sprintf('/%s', self::RELATION), self::TOKEN); $this->assertIsRelationResponse($response, 'RELATION'); $data = $this->getBody($response)['data']; - $this->assertArrayHasKey('test', $data); + $this->assertArrayHasKey('scenario', $data); $this->assertArrayHasKey('created', $data); $this->assertArrayHasKey('new-property', $data); $this->assertArrayHasKey('updated', $data); diff --git a/tests/FeatureTests/Endpoint/Scenario04PatchElement/_E4_01_PatchNodeTest.php b/tests/FeatureTests/Endpoint/Scenario04PatchElement/_E4_01_PatchNodeTest.php index 11923216..f07a124b 100644 --- a/tests/FeatureTests/Endpoint/Scenario04PatchElement/_E4_01_PatchNodeTest.php +++ b/tests/FeatureTests/Endpoint/Scenario04PatchElement/_E4_01_PatchNodeTest.php @@ -14,7 +14,7 @@ public function testPutNode(): void $response = $this->runGetRequest(sprintf('/%s', self::DATA), self::TOKEN); $this->assertIsNodeResponse($response, 'Data'); $data = $this->getBody($response)['data']; - $this->assertArrayHasKey('test', $data); + $this->assertArrayHasKey('scenario', $data); $this->assertArrayHasKey('name', $data); $this->assertArrayHasKey('created', $data); $this->assertArrayHasKey('updated', $data); @@ -32,7 +32,7 @@ public function testPutNode(): void $response = $this->runGetRequest(sprintf('/%s', self::DATA), self::TOKEN); $this->assertIsNodeResponse($response, 'Data'); $data = $this->getBody($response)['data']; - $this->assertArrayHasKey('test', $data); + $this->assertArrayHasKey('scenario', $data); $this->assertArrayHasKey('created', $data); $this->assertArrayHasKey('new-property', $data); $this->assertArrayHasKey('updated', $data); diff --git a/tests/FeatureTests/Endpoint/Scenario04PatchElement/_E4_02_PatchRelationTest.php b/tests/FeatureTests/Endpoint/Scenario04PatchElement/_E4_02_PatchRelationTest.php index e5b9e03e..957b7a6b 100644 --- a/tests/FeatureTests/Endpoint/Scenario04PatchElement/_E4_02_PatchRelationTest.php +++ b/tests/FeatureTests/Endpoint/Scenario04PatchElement/_E4_02_PatchRelationTest.php @@ -14,7 +14,7 @@ public function testPutRelation(): void $response = $this->runGetRequest(sprintf('/%s', self::RELATION), self::TOKEN); $this->assertIsRelationResponse($response, 'RELATION'); $data = $this->getBody($response)['data']; - $this->assertArrayHasKey('test', $data); + $this->assertArrayHasKey('scenario', $data); $this->assertArrayHasKey('created', $data); $this->assertArrayHasKey('updated', $data); $this->assertArrayHasNoNullValues($data); @@ -31,7 +31,7 @@ public function testPutRelation(): void $response = $this->runGetRequest(sprintf('/%s', self::RELATION), self::TOKEN); $this->assertIsRelationResponse($response, 'RELATION'); $data = $this->getBody($response)['data']; - $this->assertArrayHasKey('test', $data); + $this->assertArrayHasKey('scenario', $data); $this->assertArrayHasKey('created', $data); $this->assertArrayHasKey('new-property', $data); $this->assertArrayHasKey('updated', $data); diff --git a/tests/FeatureTests/Endpoint/User/PostChangePasswordTest.php b/tests/FeatureTests/Endpoint/User/PostChangePasswordTest.php index 860444de..cbc44403 100644 --- a/tests/FeatureTests/Endpoint/User/PostChangePasswordTest.php +++ b/tests/FeatureTests/Endpoint/User/PostChangePasswordTest.php @@ -6,7 +6,7 @@ class PostChangePasswordTest extends BaseRequestTestCase { - public const EMAIL = 'user@changePassword.user.endpoint.localhost.de'; + public const EMAIL = 'user@changePassword.user.endpoint.localhost.dev'; public const PASSWORD = '1234'; public const NEW_PASSWORD = 'abcd'; diff --git a/tests/FeatureTests/Endpoint/User/PostRegisterTest.php b/tests/FeatureTests/Endpoint/User/PostRegisterTest.php index 9f1724b6..c6f0721d 100644 --- a/tests/FeatureTests/Endpoint/User/PostRegisterTest.php +++ b/tests/FeatureTests/Endpoint/User/PostRegisterTest.php @@ -15,7 +15,7 @@ public function testPostRegister(): void 'type' => 'User', 'password' => '1234', 'data' => [ - 'email' => 'user1@register.user.endpoint.localhost.de', + 'email' => 'user1@register.user.endpoint.localhost.dev', ], ] ); @@ -31,7 +31,7 @@ public function testPostRegisterWithoutType(): void [ 'password' => '1234', 'data' => [ - 'email' => 'user2@register.user.endpoint.localhost.de', + 'email' => 'user2@register.user.endpoint.localhost.dev', ], ] ); @@ -48,7 +48,7 @@ public function testPostRegisterWithWrongType(): void 'type' => 'NotAUser', 'password' => '1234', 'data' => [ - 'email' => 'user3@register.user.endpoint.localhost.de', + 'email' => 'user3@register.user.endpoint.localhost.dev', ], ] ); @@ -64,7 +64,7 @@ public function testPostRegisterWithNoPassword(): void [ 'type' => 'User', 'data' => [ - 'email' => 'user4@register.user.endpoint.localhost.de', + 'email' => 'user4@register.user.endpoint.localhost.dev', ], ] ); @@ -97,7 +97,7 @@ public function testPostRegisterFailsForDuplicateEmail(): void 'type' => 'User', 'password' => '1234', 'data' => [ - 'email' => 'user5@register.user.endpoint.localhost.de', + 'email' => 'user5@register.user.endpoint.localhost.dev', ], ] ); @@ -111,7 +111,7 @@ public function testPostRegisterFailsForDuplicateEmail(): void 'type' => 'User', 'password' => '1234', 'data' => [ - 'email' => 'user5@register.user.endpoint.localhost.de', + 'email' => 'user5@register.user.endpoint.localhost.dev', ], ] ); diff --git a/tests/FeatureTests/Endpoint/User/PostTokenTest.php b/tests/FeatureTests/Endpoint/User/PostTokenTest.php index 6c890124..40f302c7 100644 --- a/tests/FeatureTests/Endpoint/User/PostTokenTest.php +++ b/tests/FeatureTests/Endpoint/User/PostTokenTest.php @@ -7,7 +7,7 @@ class PostTokenTest extends BaseRequestTestCase { public const TOKEN = 'secret-token:3tgEP9MhD81rkp3qiJcm1U'; - public const EMAIL = 'user@postToken.user.endpoint.localhost.de'; + public const EMAIL = 'user@postToken.user.endpoint.localhost.dev'; public const PASSWORD = '1234'; public function testPostToken(): void diff --git a/tests/FeatureTests/Security/Scenario02BasicPositiveTests/_02_01_ImmediateNodeOwnershipTest.php b/tests/FeatureTests/Security/Scenario02BasicPositiveTests/_02_01_ImmediateNodeOwnershipTest.php index 88b532ad..e537cc6d 100644 --- a/tests/FeatureTests/Security/Scenario02BasicPositiveTests/_02_01_ImmediateNodeOwnershipTest.php +++ b/tests/FeatureTests/Security/Scenario02BasicPositiveTests/_02_01_ImmediateNodeOwnershipTest.php @@ -89,7 +89,7 @@ public function test2010305(): void 'type' => 'Data', 'data' => [ 'name' => 'I shall exist.', - 'test' => '2-01', + 'scenario' => '2-01', ], ] ); diff --git a/tests/FeatureTests/Security/Scenario07SearchAccessTests/_07_01_SearchAccessTest.php b/tests/FeatureTests/Security/Scenario07SearchAccessTests/_07_01_SearchAccessTest.php index 85ca92c0..c2b9ce76 100644 --- a/tests/FeatureTests/Security/Scenario07SearchAccessTests/_07_01_SearchAccessTest.php +++ b/tests/FeatureTests/Security/Scenario07SearchAccessTests/_07_01_SearchAccessTest.php @@ -26,7 +26,7 @@ private function baseSearchTest(string $token): void [ 'query' => [ 'term' => [ - 'test.keyword' => 'security.limitedAccess.searchAccess', + 'scenario.keyword' => 'security.limitedAccess.searchAccess', ], ], 'nodeTypes' => ['Data'],