aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_versions/tests/VersioningTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_versions/tests/VersioningTest.php')
-rw-r--r--apps/files_versions/tests/VersioningTest.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/apps/files_versions/tests/VersioningTest.php b/apps/files_versions/tests/VersioningTest.php
index 4f171031ab3..f454ba30b86 100644
--- a/apps/files_versions/tests/VersioningTest.php
+++ b/apps/files_versions/tests/VersioningTest.php
@@ -37,6 +37,7 @@ namespace OCA\Files_Versions\Tests;
use OC\Files\Storage\Temporary;
use OCA\Files_Versions\Db\VersionEntity;
use OCA\Files_Versions\Db\VersionsMapper;
+use OCA\Files_Versions\Versions\IVersionManager;
use OCP\Files\IMimeTypeLoader;
use OCP\IConfig;
use OCP\IUser;
@@ -822,7 +823,12 @@ class VersioningTest extends \Test\TestCase {
$params = [];
$this->connectMockHooks('rollback', $params);
- $this->assertTrue(\OCA\Files_Versions\Storage::rollback('sub/test.txt', $t2, $this->user1));
+ $versionManager = \OCP\Server::get(IVersionManager::class);
+ $versions = $versionManager->getVersionsForFile($this->user1, $info1);
+ $version = array_filter($versions, function ($version) use ($t2) {
+ return $version->getRevisionId() === $t2;
+ });
+ $this->assertTrue($versionManager->rollback(current($version)));
$expectedParams = [
'path' => '/sub/test.txt',
];