From 5af08c516bf5e2d582245b7c052d1a1b8ea80d99 Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Tue, 14 Dec 2021 10:10:13 +0545 Subject: [PATCH] [tests-only] Minor local API test changes --- tests/acceptance/config/behat.yml | 16 +++------------- .../features/bootstrap/ArchiverContext.php | 3 +-- .../features/bootstrap/RevaContext.php | 2 +- .../features/bootstrap/SpacesContext.php | 10 +++++----- 4 files changed, 10 insertions(+), 21 deletions(-) diff --git a/tests/acceptance/config/behat.yml b/tests/acceptance/config/behat.yml index 016de39b49..02d11fb3bb 100644 --- a/tests/acceptance/config/behat.yml +++ b/tests/acceptance/config/behat.yml @@ -6,7 +6,7 @@ default: apiAccountsHashDifficulty: paths: - '%paths.base%/../features/apiAccountsHashDifficulty' - context: &common_ldap_suite_context + context: parameters: ldapAdminPassword: admin ldapUsersOU: TestUsers @@ -34,12 +34,7 @@ default: contexts: - SpacesContext: - OccContext: - - FeatureContext: &common_feature_context_params - baseUrl: http://localhost:8080 - adminUsername: admin - adminPassword: admin - regularUserPassword: 123456 - ocPath: apps/testing/api/v1/occ + - FeatureContext: *common_feature_context_params - CapabilitiesContext: - ChecksumContext: - FavoritesContext: @@ -54,12 +49,7 @@ default: contexts: - ArchiverContext: - OccContext: - - FeatureContext: &common_feature_context_params - baseUrl: http://localhost:8080 - adminUsername: admin - adminPassword: admin - regularUserPassword: 123456 - ocPath: apps/testing/api/v1/occ + - FeatureContext: *common_feature_context_params - CapabilitiesContext: - ChecksumContext: - FilesVersionsContext: diff --git a/tests/acceptance/features/bootstrap/ArchiverContext.php b/tests/acceptance/features/bootstrap/ArchiverContext.php index 4ebd96b267..3be54893ad 100644 --- a/tests/acceptance/features/bootstrap/ArchiverContext.php +++ b/tests/acceptance/features/bootstrap/ArchiverContext.php @@ -38,7 +38,7 @@ class ArchiverContext implements Context { /** * @var FeatureContext */ - private $featureContext; + private FeatureContext $featureContext; /** * @BeforeScenario @@ -80,7 +80,6 @@ class ArchiverContext implements Context { case 'id': case 'ids': return 'id=' . $this->featureContext->getFileIdForPath($user, $resource); - break; case 'path': case 'paths': return 'path=' . $resource; diff --git a/tests/acceptance/features/bootstrap/RevaContext.php b/tests/acceptance/features/bootstrap/RevaContext.php index b74ff023d2..fbf77172fc 100644 --- a/tests/acceptance/features/bootstrap/RevaContext.php +++ b/tests/acceptance/features/bootstrap/RevaContext.php @@ -34,7 +34,7 @@ class RevaContext implements Context { /** * @var FeatureContext */ - private $featureContext; + private FeatureContext $featureContext; /** * @BeforeScenario diff --git a/tests/acceptance/features/bootstrap/SpacesContext.php b/tests/acceptance/features/bootstrap/SpacesContext.php index bfe573f16a..5dec1726a2 100644 --- a/tests/acceptance/features/bootstrap/SpacesContext.php +++ b/tests/acceptance/features/bootstrap/SpacesContext.php @@ -185,14 +185,14 @@ class SpacesContext implements Context { * * @return array */ - public function getSpaceByName(string $user, string $name): array { + public function getSpaceByName(string $user, string $spaceName): array { $this->theUserListsAllHisAvailableSpacesUsingTheGraphApi($user); $spaces = $this->getAvailableSpaces(); - Assert::assertIsArray($spaces[$name], "Space with name $name for user $user not found"); - Assert::assertNotEmpty($spaces[$name]["root"]["webDavUrl"], "WebDavUrl for space with name $name for user $user not found"); + Assert::assertIsArray($spaces[$spaceName], "Space with name $spaceName for user $user not found"); + Assert::assertNotEmpty($spaces[$spaceName]["root"]["webDavUrl"], "WebDavUrl for space with name $spaceName for user $user not found"); - return $spaces[$name]; + return $spaces[$spaceName]; } /** @@ -604,7 +604,7 @@ class SpacesContext implements Context { * * @throws Exception|GuzzleException */ - public function usertheSpaceShouldContainEntries( + public function userTheSpaceShouldContainEntries( string $user, string $spaceName, string $shouldOrNot,