-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #50208 from nextcloud/feat/conversion-adjusting
fix(files): conversion api simplification and conflict check
- Loading branch information
Showing
18 changed files
with
358 additions
and
126 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
SPDX-FileCopyrightText: 2019 CHUTTERSNAP <https://unsplash.com/@chuttersnap> <https://unsplash.com/photos/blue-clouds-under-white-sky-9AqIdzEc9pY>" | ||
SPDX-License-Identifier: LicenseRef-Unsplash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
build/integration/features/bootstrap/ConversionsContext.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<?php | ||
/** | ||
* SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors | ||
* SPDX-FileCopyrightText: 2016 ownCloud, Inc. | ||
* SPDX-License-Identifier: AGPL-3.0-or-later | ||
*/ | ||
require __DIR__ . '/../../vendor/autoload.php'; | ||
|
||
use Behat\Behat\Context\Context; | ||
use Behat\Behat\Context\SnippetAcceptingContext; | ||
use Behat\Gherkin\Node\TableNode; | ||
|
||
class ConversionsContext implements Context, SnippetAcceptingContext { | ||
use AppConfiguration; | ||
use BasicStructure; | ||
use WebDav; | ||
|
||
/** @BeforeScenario */ | ||
public function setUpScenario() { | ||
$this->asAn('admin'); | ||
$this->setStatusTestingApp(true); | ||
} | ||
|
||
/** @AfterScenario */ | ||
public function tearDownScenario() { | ||
$this->asAn('admin'); | ||
$this->setStatusTestingApp(false); | ||
} | ||
|
||
protected function resetAppConfigs() { | ||
} | ||
|
||
/** | ||
* @When /^user "([^"]*)" converts file "([^"]*)" to "([^"]*)"$/ | ||
*/ | ||
public function userConvertsTheSavedFileId(string $user, string $path, string $mime) { | ||
$this->userConvertsTheSavedFileIdTo($user, $path, $mime, null); | ||
} | ||
|
||
/** | ||
* @When /^user "([^"]*)" converts file "([^"]*)" to "([^"]*)" and saves it to "([^"]*)"$/ | ||
*/ | ||
public function userConvertsTheSavedFileIdTo(string $user, string $path, string $mime, ?string $destination) { | ||
try { | ||
$fileId = $this->getFileIdForPath($user, $path); | ||
} catch (Exception $e) { | ||
// return a fake value to keep going and be able to test the error | ||
$fileId = 0; | ||
} | ||
|
||
$data = [['fileId', $fileId], ['targetMimeType', $mime]]; | ||
if ($destination !== null) { | ||
$data[] = ['destination', $destination]; | ||
} | ||
|
||
$this->asAn($user); | ||
$this->sendingToWith('post', '/apps/files/api/v1/convert', new TableNode($data)); | ||
} | ||
} |
Oops, something went wrong.