Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[tests-only] Remove the similar step for exporting mount storage #40435

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -201,7 +201,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