diff options
author | blizzz <blizzz@arthur-schiwon.de> | 2022-10-01 21:47:26 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-01 21:47:26 +0200 |
commit | ca958de7e9738ba40f5170f9c3d4980374566fa2 (patch) | |
tree | 67d2f0ecf7c65268c0256d89c28c5c4189e93463 /tests | |
parent | 2b854c104433a8c38e2f8bd50d4af70526d06090 (diff) | |
parent | cb51564356e111c79224401b9067d755ac5f5c42 (diff) | |
download | nextcloud-server-ca958de7e9738ba40f5170f9c3d4980374566fa2.tar.gz nextcloud-server-ca958de7e9738ba40f5170f9c3d4980374566fa2.zip |
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.php | 19 |
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')); + } } |