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:
authorVincent Petry <pvince81@owncloud.com>2014-01-31 19:06:11 +0400
committerVincent Petry <pvince81@owncloud.com>2014-02-19 21:34:08 +0400
commitb2b35cd3358113db95651d705251eda290b40ba7 (patch)
tree5a8b39a105e3a7c06f6fcee0412813cf85c4226e /tests
parent952584e9c782d196eb2bcd6df1e3ecdf21adcb55 (diff)
Fixed ext storage webdav path encoding
- Some WebDAV servers like lighttpd need paths in URLs to be properly encoded - Added error log output when curl connection failed - Added check for 'resourcetype' in case the WebDAV server doesn't support/return it - Fixed touch() to return false if the server doesn't implement PROPPATCH - Added optional delay in WebDAV unit tests to use when testing against lighttpd's WebDAV
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/files/storage/storage.php19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/lib/files/storage/storage.php b/tests/lib/files/storage/storage.php
index 182c014d999..f9291758606 100644
--- a/tests/lib/files/storage/storage.php
+++ b/tests/lib/files/storage/storage.php
@@ -27,6 +27,17 @@ abstract class Storage extends \PHPUnit_Framework_TestCase {
* @var \OC\Files\Storage\Storage instance
*/
protected $instance;
+ protected $waitDelay = 0;
+
+ /**
+ * Sleep for the number of seconds specified in the
+ * $waitDelay attribute
+ */
+ protected function wait() {
+ if ($this->waitDelay > 0) {
+ sleep($this->waitDelay);
+ }
+ }
/**
* the root folder of the storage should always exist, be readable and be recognized as a directory
@@ -77,6 +88,7 @@ abstract class Storage extends \PHPUnit_Framework_TestCase {
$this->assertFalse($this->instance->mkdir('/'.$directory)); //cant create existing folders
$this->assertTrue($this->instance->rmdir('/'.$directory));
+ $this->wait();
$this->assertFalse($this->instance->file_exists('/'.$directory));
$this->assertFalse($this->instance->rmdir('/'.$directory)); //cant remove non existing folders
@@ -97,6 +109,8 @@ abstract class Storage extends \PHPUnit_Framework_TestCase {
array('folder'),
array(' folder'),
array('folder '),
+ array('folder with space'),
+ array('spéciäl földer'),
);
}
/**
@@ -144,6 +158,7 @@ abstract class Storage extends \PHPUnit_Framework_TestCase {
$this->assertEquals($this->instance->file_get_contents('/source.txt'), $this->instance->file_get_contents('/target.txt'));
$this->instance->rename('/source.txt', '/target2.txt');
+ $this->wait();
$this->assertTrue($this->instance->file_exists('/target2.txt'));
$this->assertFalse($this->instance->file_exists('/source.txt'));
$this->assertEquals(file_get_contents($textFile), $this->instance->file_get_contents('/target2.txt'));
@@ -225,6 +240,7 @@ abstract class Storage extends \PHPUnit_Framework_TestCase {
$this->assertTrue($this->instance->file_exists('/lorem.txt'));
$this->assertTrue($this->instance->unlink('/lorem.txt'));
+ $this->wait();
$this->assertFalse($this->instance->file_exists('/lorem.txt'));
}
@@ -259,9 +275,11 @@ abstract class Storage extends \PHPUnit_Framework_TestCase {
public function testRecursiveRmdir() {
$this->instance->mkdir('folder');
$this->instance->mkdir('folder/bar');
+ $this->wait();
$this->instance->file_put_contents('folder/asd.txt', 'foobar');
$this->instance->file_put_contents('folder/bar/foo.txt', 'asd');
$this->assertTrue($this->instance->rmdir('folder'));
+ $this->wait();
$this->assertFalse($this->instance->file_exists('folder/asd.txt'));
$this->assertFalse($this->instance->file_exists('folder/bar/foo.txt'));
$this->assertFalse($this->instance->file_exists('folder/bar'));
@@ -274,6 +292,7 @@ abstract class Storage extends \PHPUnit_Framework_TestCase {
$this->instance->file_put_contents('folder/asd.txt', 'foobar');
$this->instance->file_put_contents('folder/bar/foo.txt', 'asd');
$this->assertTrue($this->instance->unlink('folder'));
+ $this->wait();
$this->assertFalse($this->instance->file_exists('folder/asd.txt'));
$this->assertFalse($this->instance->file_exists('folder/bar/foo.txt'));
$this->assertFalse($this->instance->file_exists('folder/bar'));