Skip to content

Commit

Permalink
Remove the similar step
Browse files Browse the repository at this point in the history
  • Loading branch information
grgprarup committed Oct 25, 2022
1 parent 8e098bd commit 47b82b8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 38 deletions.
2 changes: 1 addition & 1 deletion tests/acceptance/features/bootstrap/OccContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -2492,7 +2492,7 @@ public function theAdministratorImportsTheMountFromFileUsingTheOccCommand(string
}

/**
* @Given the administrator has exported the local storage mounts using the occ command
* @Given /^the administrator has exported the (local|external) storage mounts using the occ command$/
*
* @return void
* @throws Exception
Expand Down
36 changes: 0 additions & 36 deletions tests/acceptance/features/bootstrap/WebDav.php
Original file line number Diff line number Diff line change
Expand Up @@ -3278,42 +3278,6 @@ public function userHasUploadedAFileWithContentTo(
return $fileId;
}

/**
* @Given the administrator has created a json file with exported config of local storage mount :mount to :destination in temporary storage
*
* @param string $mount
* @param string $destination
*
* @return void
* @throws Exception
* @throws GuzzleException
*/
public function theAdminHasCreatedAJsonFileWithExportedMountConfig(
string $mount,
string $destination
): void {
$actualConfig = null;
$commandOutput = \json_decode(
SetupHelper::runOcc(
['files_external:export'],
$this->getStepLineRef()
)['stdOut']
);

//identifying the correct config and also removing the "mount id" property
foreach ($commandOutput as $i) {
if ($mount === \ltrim($i->mount_point, '/')) {
unset($i->mount_id);
$actualConfig = $i;
break;
}
}

$actualConfig = json_encode($actualConfig);
$this->copyContentToFileInTemporaryStorageOnSystemUnderTest($destination, $actualConfig);
$this->theFileWithContentShouldExistInTheServerRoot(TEMPORARY_STORAGE_DIR_ON_REMOTE_SERVER . "/$destination", $actualConfig);
}

/**
* @Given /^user "([^"]*)" has uploaded the following files with content "([^"]*)"$/
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,9 @@ Feature: using files external service with storage as webdav_owncloud
| storage_backend | owncloud |
| mount_point | TestMountPoint |
| authentication_backend | password::password |
And the administrator has created a json file with exported config of local storage mount "TestMountPoint" to "mountConfig.json" in temporary storage
And the administrator has exported the external storage mounts using the occ command
And the administrator has created a file "mountConfig.json" in temporary storage with the last exported content using the testing API
And the administrator has deleted local storage "local_storage" using the occ command
And the administrator has deleted external storage with mount point "TestMountPoint"
When the administrator imports the local storage mount from file "mountConfig.json" using the occ command
Then the command should have been successful
Expand Down

0 comments on commit 47b82b8

Please sign in to comment.