summaryrefslogtreecommitdiffstats
path: root/tests/lib
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2013-11-27 18:48:24 +0100
committerVincent Petry <pvince81@owncloud.com>2013-11-27 21:34:51 +0100
commit43b1cf798839888e9e7266d80f55f6ce6f74d852 (patch)
treef4c37388ce477881e14ffb80f157ae91bfadc466 /tests/lib
parent40231c08cf617b5909dee778372d6b1b8cdd5bcf (diff)
downloadnextcloud-server-43b1cf798839888e9e7266d80f55f6ce6f74d852.tar.gz
nextcloud-server-43b1cf798839888e9e7266d80f55f6ce6f74d852.zip
Redetect mime type whenever extension is renamed
Diffstat (limited to 'tests/lib')
-rw-r--r--tests/lib/files/cache/updater.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/lib/files/cache/updater.php b/tests/lib/files/cache/updater.php
index e3d3aae818d..91e384e12af 100644
--- a/tests/lib/files/cache/updater.php
+++ b/tests/lib/files/cache/updater.php
@@ -202,6 +202,14 @@ class Updater extends \PHPUnit_Framework_TestCase {
$this->assertNotEquals($rootCachedData['etag'], $cachedData['etag']);
}
+ public function testRenameExtension() {
+ $fooCachedData = $this->cache->get('foo.txt');
+ $this->assertEquals('text/plain', $fooCachedData['mimetype']);
+ Filesystem::rename('foo.txt', 'foo.abcd');
+ $fooCachedData = $this->cache->get('foo.abcd');
+ $this->assertEquals('application/octet-stream', $fooCachedData['mimetype']);
+ }
+
public function testRenameWithMountPoints() {
$storage2 = new \OC\Files\Storage\Temporary(array());
$cache2 = $storage2->getCache();