Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/streamwrappers.php19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/lib/streamwrappers.php b/tests/lib/streamwrappers.php
index e40f2e76128..2237ee7d378 100644
--- a/tests/lib/streamwrappers.php
+++ b/tests/lib/streamwrappers.php
@@ -75,4 +75,23 @@ class Test_StreamWrappers extends PHPUnit_Framework_TestCase {
public static function closeCallBack($path) {
throw new Exception($path);
}
+
+ public function testOC() {
+ \OC\Files\Mount::clear();
+ $storage = new \OC\Files\Storage\Temporary(array());
+ $storage->file_put_contents('foo.txt', 'asd');
+ new \OC\Files\Mount($storage, '/');
+
+ $this->assertTrue(file_exists('oc:///foo.txt'));
+ $this->assertEquals('asd', file_get_contents('oc:///foo.txt'));
+ $this->assertEquals(array('.', '..', 'foo.txt'), scandir('oc:///'));
+
+ file_put_contents('oc:///bar.txt', 'qwerty');
+ $this->assertEquals('qwerty', $storage->file_get_contents('bar.txt'));
+ $this->assertEquals(array('.', '..', 'bar.txt', 'foo.txt'), scandir('oc:///'));
+ $this->assertEquals('qwerty', file_get_contents('oc:///bar.txt'));
+
+ unlink('oc:///foo.txt');
+ $this->assertEquals(array('.', '..', 'bar.txt'), scandir('oc:///'));
+ }
}