aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/Files
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2019-12-04 11:49:26 +0100
committerGitHub <noreply@github.com>2019-12-04 11:49:26 +0100
commit76b78edd40fcb5dbe7f0434cbc41d2e291acfec1 (patch)
tree8a9e487e080cbdd001cd2bf5f2fb5feacb69ae25 /tests/lib/Files
parentd4f1cc7da6a2d7834099750827a50dcc675c64e5 (diff)
parent74c6beb603f18d51d92730bb631bfe77d8feb400 (diff)
downloadnextcloud-server-76b78edd40fcb5dbe7f0434cbc41d2e291acfec1.tar.gz
nextcloud-server-76b78edd40fcb5dbe7f0434cbc41d2e291acfec1.zip
Merge pull request #17833 from nextcloud/propagator-no-negative-sizes
dont set folder size to negative values during propagation
Diffstat (limited to 'tests/lib/Files')
-rw-r--r--tests/lib/Files/Cache/PropagatorTest.php11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/lib/Files/Cache/PropagatorTest.php b/tests/lib/Files/Cache/PropagatorTest.php
index ce6b84ee4d0..c1822c90282 100644
--- a/tests/lib/Files/Cache/PropagatorTest.php
+++ b/tests/lib/Files/Cache/PropagatorTest.php
@@ -81,6 +81,17 @@ class PropagatorTest extends TestCase {
}
}
+ public function testSizePropagationNoNegative() {
+ $paths = ['', 'foo', 'foo/bar'];
+ $oldInfos = $this->getFileInfos($paths);
+ $this->storage->getPropagator()->propagateChange('foo/bar/file.txt', time(), -100);
+ $newInfos = $this->getFileInfos($paths);
+
+ foreach ($oldInfos as $i => $oldInfo) {
+ $this->assertEquals(-1, $newInfos[$i]->getSize());
+ }
+ }
+
public function testBatchedPropagation() {
$this->storage->mkdir('foo/baz');
$this->storage->mkdir('asd');