diff options
author | Julius Härtl <jus@bitgrid.net> | 2023-02-14 12:38:51 +0100 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2023-03-13 10:52:37 +0100 |
commit | c22d51c1ad939e1bf2a2b78f8fb3329a5269c9e7 (patch) | |
tree | f357405c1ae2baf59361303159d12995562967cf /apps/files_versions/tests | |
parent | cf46bd691566833ee60e8939872d16425f48a64e (diff) | |
download | nextcloud-server-c22d51c1ad939e1bf2a2b78f8fb3329a5269c9e7.tar.gz nextcloud-server-c22d51c1ad939e1bf2a2b78f8fb3329a5269c9e7.zip |
tests(files_versions): Tear down fs to clear mount cache before testing
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'apps/files_versions/tests')
-rw-r--r-- | apps/files_versions/tests/VersioningTest.php | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/apps/files_versions/tests/VersioningTest.php b/apps/files_versions/tests/VersioningTest.php index 4f171031ab3..547f1eca4a6 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; @@ -661,6 +662,7 @@ class VersioningTest extends \Test\TestCase { public function testRestoreCrossStorage() { $storage2 = new Temporary([]); \OC\Files\Filesystem::mount($storage2, [], self::TEST_VERSIONS_USER . '/files/sub'); + \OC\Files\Filesystem::tearDown(); $this->doTestRestore(); } @@ -822,7 +824,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', ]; |