Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorblizzz <blizzz@arthur-schiwon.de>2022-10-01 22:47:26 +0300
committerGitHub <noreply@github.com>2022-10-01 22:47:26 +0300
commitca958de7e9738ba40f5170f9c3d4980374566fa2 (patch)
tree67d2f0ecf7c65268c0256d89c28c5c4189e93463 /tests
parent2b854c104433a8c38e2f8bd50d4af70526d06090 (diff)
parentcb51564356e111c79224401b9067d755ac5f5c42 (diff)
Merge pull request #33566 from nextcloud/fopen-not-found-rescan
trigger a rescan when trying to fopen a file that exists in cache but not on disk
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/Files/ViewTest.php19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/lib/Files/ViewTest.php b/tests/lib/Files/ViewTest.php
index 86101d79a1e..2189e7c09f4 100644
--- a/tests/lib/Files/ViewTest.php
+++ b/tests/lib/Files/ViewTest.php
@@ -2709,4 +2709,23 @@ class ViewTest extends \Test\TestCase {
$this->assertEquals(25, $info->getUploadTime());
$this->assertEquals(0, $info->getCreationTime());
}
+
+ public function testFopenGone() {
+ $storage = new Temporary([]);
+ $scanner = $storage->getScanner();
+ $storage->file_put_contents('foo.txt', 'bar');
+ $scanner->scan('');
+ $cache = $storage->getCache();
+
+ Filesystem::mount($storage, [], '/test/');
+ $view = new View('/test');
+
+ $storage->unlink('foo.txt');
+
+ $this->assertTrue($cache->inCache('foo.txt'));
+
+ $this->assertFalse($view->fopen('foo.txt', 'r'));
+
+ $this->assertFalse($cache->inCache('foo.txt'));
+ }
}