diff options
author | Christian Berendt <berendt@b1-systems.de> | 2013-07-03 18:23:09 +0200 |
---|---|---|
committer | Christian Berendt <berendt@b1-systems.de> | 2013-07-03 18:23:09 +0200 |
commit | 0a5e18335ec4fef9fc0ea7b6778628b7471962bd (patch) | |
tree | 82eb83a87014c70669e76e32f13a0985a52b2882 /tests | |
parent | e556b7ab5504a039553f92696be6124db51a2a39 (diff) | |
download | nextcloud-server-0a5e18335ec4fef9fc0ea7b6778628b7471962bd.tar.gz nextcloud-server-0a5e18335ec4fef9fc0ea7b6778628b7471962bd.zip |
test working with files in subdirectories
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/files/storage/storage.php | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/lib/files/storage/storage.php b/tests/lib/files/storage/storage.php index e5cc9483871..8f6a8771ba8 100644 --- a/tests/lib/files/storage/storage.php +++ b/tests/lib/files/storage/storage.php @@ -127,6 +127,16 @@ abstract class Storage extends \PHPUnit_Framework_TestCase { $this->assertFalse($this->instance->is_dir('/folder')); $this->assertFalse($this->instance->is_dir('/folder/sub_a')); $this->assertFalse($this->instance->file_exists('/folder/sub_a/file.txt')); + + // check if it's working inside directories as well + $this->instance->mkdir('/folder'); + $this->instance->file_put_contents('/folder/lorem.txt', $sourceText); + $this->assertFalse($this->instance->is_dir('/folder/lorem.txt')); + $this->assertEquals($sourceText, $this->instance->file_get_contents('/folder/lorem.txt'), 'data returned from file_get_contents is not equal to the source data'); + $this->instance->file_put_contents('/folder/lorem.txt', ''); + $this->assertEquals('', $this->instance->file_get_contents('/folder/lorem.txt'), 'file not emptied'); + $this->instance->rmdir('/folder'); + $this->assertFalse($this->instance->file_exists('/folder/lorem.txt')); } /** |