summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2015-12-15 13:48:17 +0100
committerRobin Appelman <icewind@owncloud.com>2015-12-15 13:48:17 +0100
commit38a2467a4f6344affc17a4c21862b047bfdf51e1 (patch)
treefb09c6240585ad0e8d5bfe35d6675e4b0e51f00c
parentdb41c4f4b5f27757838ba17c03f6f263b91af527 (diff)
downloadnextcloud-server-38a2467a4f6344affc17a4c21862b047bfdf51e1.tar.gz
nextcloud-server-38a2467a4f6344affc17a4c21862b047bfdf51e1.zip
test for statcache after fopen
-rw-r--r--tests/lib/files/storage/storage.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/lib/files/storage/storage.php b/tests/lib/files/storage/storage.php
index d381b4cdf40..95dd70bfdac 100644
--- a/tests/lib/files/storage/storage.php
+++ b/tests/lib/files/storage/storage.php
@@ -598,4 +598,17 @@ abstract class Storage extends \Test\TestCase {
$this->instance->mkdir('source');
$this->assertTrue($this->instance->isSharable('source'));
}
+
+ public function testStatAfterWrite() {
+ $this->instance->file_put_contents('foo.txt', 'bar');
+ $stat = $this->instance->stat('foo.txt');
+ $this->assertEquals(3, $stat['size']);
+
+ $fh = $this->instance->fopen('foo.txt', 'w');
+ fwrite($fh, 'qwerty');
+ fclose($fh);
+
+ $stat = $this->instance->stat('foo.txt');
+ $this->assertEquals(6, $stat['size']);
+ }
}