diff options
author | Vincent Petry <pvince81@owncloud.com> | 2016-06-07 16:29:23 +0200 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2016-06-07 16:29:23 +0200 |
commit | 15fffb2b10d8f6c5040ea1dc7e27931c5db497a2 (patch) | |
tree | d4b520c216773441a5d0418c864c26f41d2062e7 /apps/files_external/tests/Storage | |
parent | 46fe2ddf2e7a4413586095143521684a0377daad (diff) | |
download | nextcloud-server-15fffb2b10d8f6c5040ea1dc7e27931c5db497a2.tar.gz nextcloud-server-15fffb2b10d8f6c5040ea1dc7e27931c5db497a2.zip |
Fix GDrive upload file which name might match the one of a folder
Whenever a file is uploaded to GDrive, there is a check for that file
with and without extension, due to Google Docs files having no
extension. This logic now only kicks in whenever the detected
extensionless file is really a Google Doc file, not a folder.
This makes it possible again to upload a file "test.txt" in a folder
that also has a folder called "test"
Diffstat (limited to 'apps/files_external/tests/Storage')
-rw-r--r-- | apps/files_external/tests/Storage/GoogleTest.php | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/apps/files_external/tests/Storage/GoogleTest.php b/apps/files_external/tests/Storage/GoogleTest.php index 7684fec8429..eb19cc463b1 100644 --- a/apps/files_external/tests/Storage/GoogleTest.php +++ b/apps/files_external/tests/Storage/GoogleTest.php @@ -60,4 +60,13 @@ class GoogleTest extends \Test\Files\Storage\Storage { parent::tearDown(); } + + public function testSameNameAsFolderWithExtension() { + $this->assertTrue($this->instance->mkdir('testsamename')); + $this->assertEquals(13, $this->instance->file_put_contents('testsamename.txt', 'some contents')); + $this->assertEquals('some contents', $this->instance->file_get_contents('testsamename.txt')); + $this->assertTrue($this->instance->is_dir('testsamename')); + $this->assertTrue($this->instance->unlink('testsamename.txt')); + $this->assertTrue($this->instance->rmdir('testsamename')); + } } |