From 38a2467a4f6344affc17a4c21862b047bfdf51e1 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Tue, 15 Dec 2015 13:48:17 +0100 Subject: [PATCH] test for statcache after fopen --- tests/lib/files/storage/storage.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/lib/files/storage/storage.php b/tests/lib/files/storage/storage.php index d381b4cdf4..95dd70bfda 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']); + } }