summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2016-10-15 22:50:38 +0200
committerMorris Jobke <hey@morrisjobke.de>2016-10-20 20:46:30 +0200
commit9e9fef46d91a4850c75684c8d18f77620c7edb55 (patch)
treecae666215038562816e90a1ef70e4af05eb82538 /tests
parentd9aeee2aa1f2d47c950a4e053a47b38a040b62b5 (diff)
downloadnextcloud-server-9e9fef46d91a4850c75684c8d18f77620c7edb55.tar.gz
nextcloud-server-9e9fef46d91a4850c75684c8d18f77620c7edb55.zip
Get rid of very old oc:// stream wrapper (#26381)
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/StreamWrappersTest.php36
1 files changed, 0 insertions, 36 deletions
diff --git a/tests/lib/StreamWrappersTest.php b/tests/lib/StreamWrappersTest.php
index a378f975fde..c0ecb5e738b 100644
--- a/tests/lib/StreamWrappersTest.php
+++ b/tests/lib/StreamWrappersTest.php
@@ -77,40 +77,4 @@ class StreamWrappersTest extends \Test\TestCase {
fclose($fh);
$this->assertSame($tmpFile, $actual);
}
-
- public function testOC() {
- // FIXME: use proper tearDown with $this->loginAsUser() and $this->logout()
- // (would currently break the tests for some reason)
- $originalStorage = \OC\Files\Filesystem::getStorage('/');
- \OC\Files\Filesystem::clearMounts();
-
- $storage = new \OC\Files\Storage\Temporary(array());
- $storage->file_put_contents('foo.txt', 'asd');
- \OC\Files\Filesystem::mount($storage, array(), '/');
-
- $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'));
-
- $fh = fopen('oc:///bar.txt', 'rb');
- $this->assertSame(0, ftell($fh));
- $content = fread($fh, 4);
- $this->assertSame(4, ftell($fh));
- $this->assertSame('qwer', $content);
- $content = fread($fh, 1);
- $this->assertSame(5, ftell($fh));
- $this->assertSame(0, fseek($fh, 0));
- $this->assertSame(0, ftell($fh));
-
- unlink('oc:///foo.txt');
- $this->assertEquals(array('.', '..', 'bar.txt'), scandir('oc:///'));
-
- \OC\Files\Filesystem::clearMounts();
- \OC\Files\Filesystem::mount($originalStorage, array(), '/');
- }
}