Author: ts
Date: Tue Sep 25 12:23:58 2007
New Revision: 6265
Log:
- Make COPY request in memory backend also pay attention to MOVE.
# Since it it used internally.
- Added better environment for testcase rfc/move_collection.
Modified:
trunk/Webdav/src/backend/memory.php
trunk/Webdav/tests/client_test_rfc_backend.php
Modified: trunk/Webdav/src/backend/memory.php
==============================================================================
--- trunk/Webdav/src/backend/memory.php [iso-8859-1] (original)
+++ trunk/Webdav/src/backend/memory.php [iso-8859-1] Tue Sep 25 12:23:58 2007
@@ -423,7 +423,7 @@
*/
protected function performCopy( $fromPath, $toPath, $depth =
ezcWebdavRequest::DEPTH_INFINITY )
{
- $causeErrors = (bool) ( $this->options->failingOperations &
ezcWebdavMemoryBackendOptions::REQUEST_COPY );
+ $causeErrors = (bool) ( $this->options->failingOperations & (
ezcWebdavMemoryBackendOptions::REQUEST_COPY |
ezcWebdavMemoryBackendOptions::REQUEST_MOVE ) );
$errors = array();
if ( !is_array( $this->content[$fromPath] ) ||
Modified: trunk/Webdav/tests/client_test_rfc_backend.php
==============================================================================
--- trunk/Webdav/tests/client_test_rfc_backend.php [iso-8859-1] (original)
+++ trunk/Webdav/tests/client_test_rfc_backend.php [iso-8859-1] Tue Sep 25
12:23:58 2007
@@ -13,7 +13,6 @@
case 'lockdiscovery':
case 'supportedlock':
case 'propfind_allprop':
- case 'move_collection':
case 'delete':
return self::getFooBarSetup1( $test );
case 'propfind_prop':
@@ -22,6 +21,8 @@
return self::getFooBarSetup3( $test );
case 'copy_collection':
return self::getFooBarSetup4( $test );
+ case 'move_collection':
+ return self::getFooBarSetup5( $test );
case 'copy_success':
case 'copy':
case 'copy_overwrite':
@@ -403,6 +404,156 @@
return $test->backend;
}
+ protected static function getFooBarSetup5( ezcWebdavClientTest $test )
+ {
+ $test->transport->options->pathFactory = new ezcWebdavPathFactory(
'http://www.foo.bar' );
+
+ $test->backend = new
ezcWebdavMemoryBackend();
+ $test->backend->options->failForRegexp = '(othercontainer/C2)';
+ $test->backend->options->failingOperations =
ezcWebdavMemoryBackendOptions::REQUEST_MOVE;
+
+ $test->backend->addContents(
+ array(
+ 'container' => array(
+ 'front.html' => '',
+ 'C2/' => array(),
+ 'resource3' => '',
+ ),
+ )
+ );
+
+ $test->backend->setProperty(
+ '/container',
+ new ezcWebdavDeadProperty(
+ 'http://www.foo.bar/boxschema/',
+ 'bigbox',
+ <<<EOT
+<?xml version="1.0" encoding="utf-8" ?>
+<R:bigbox xmlns:R="http://www.foo.bar/boxschema/">
+<R:BoxType>Box type A</R:BoxType>
+</R:bigbox>
+EOT
+ )
+ );
+ $test->backend->setProperty(
+ '/container',
+ new ezcWebdavDeadProperty(
+ 'http://www.foo.bar/boxschema/',
+ 'author',
+ <<<EOT
+<?xml version="1.0" encoding="utf-8" ?>
+<R:author xmlns:R="http://www.foo.bar/boxschema/">
+<R:Name>Hadrian</R:Name>
+</R:author>
+EOT
+ )
+ );
+ $test->backend->setProperty(
+ '/container',
+ new ezcWebdavCreationDateProperty(
+ new DateTime( '1997-12-01T17:42:21-08:00' )
+ )
+ );
+ $test->backend->setProperty(
+ '/container',
+ new ezcWebdavDisplayNameProperty(
+ 'Example collection'
+ )
+ );
+ $test->backend->setProperty(
+ '/container',
+ new ezcWebdavResourceTypeProperty(
+ 'collection'
+ )
+ );
+ $test->backend->setProperty(
+ '/container',
+ new ezcWebdavSupportedLockProperty(
+ array(
+ new ezcWebdavSupportedLockPropertyLockentry(
+ ezcWebdavLockRequest::TYPE_WRITE,
+ ezcWebdavLockRequest::SCOPE_EXCLUSIVE
+ ),
+ new ezcWebdavSupportedLockPropertyLockentry(
+ ezcWebdavLockRequest::TYPE_WRITE,
+ ezcWebdavLockRequest::SCOPE_SHARED
+ ),
+ )
+ )
+ );
+
+ $test->backend->setProperty(
+ '/container/front.html',
+ new ezcWebdavDeadProperty(
+ 'http://www.foo.bar/boxschema/',
+ 'bigbox',
+ <<<EOT
+<?xml version="1.0" encoding="utf-8" ?>
+<R:bigbox xmlns:R="http://www.foo.bar/boxschema/">
+<R:BoxType>Box type B</R:BoxType>
+</R:bigbox>
+EOT
+ )
+ );
+ $test->backend->setProperty(
+ '/container/front.html',
+ new ezcWebdavCreationDateProperty(
+ new DateTime( '1997-12-01T18:27:21-08:00' )
+ )
+ );
+ $test->backend->setProperty(
+ '/container/front.html',
+ new ezcWebdavDisplayNameProperty(
+ 'Example HTML resource'
+ )
+ );
+ $test->backend->setProperty(
+ '/container/front.html',
+ new ezcWebdavGetContentLengthProperty(
+ '4525'
+ )
+ );
+ $test->backend->setProperty(
+ '/container/front.html',
+ new ezcWebdavGetContentTypeProperty(
+ 'text/html'
+ )
+ );
+ $test->backend->setProperty(
+ '/container/front.html',
+ new ezcWebdavGetEtagProperty(
+ 'zzyzx'
+ )
+ );
+ $test->backend->setProperty(
+ '/container/front.html',
+ new ezcWebdavGetLastModifiedProperty(
+ new DateTime( 'Monday, 12-Jan-98 09:25:56 GMT' )
+ )
+ );
+ $test->backend->setProperty(
+ '/container/front.html',
+ new ezcWebdavResourceTypeProperty()
+ );
+ $test->backend->setProperty(
+ '/container/front.html',
+ new ezcWebdavSupportedLockProperty(
+ array(
+ new ezcWebdavSupportedLockPropertyLockentry(
+ ezcWebdavLockRequest::TYPE_WRITE,
+ ezcWebdavLockRequest::SCOPE_EXCLUSIVE
+ ),
+ new ezcWebdavSupportedLockPropertyLockentry(
+ ezcWebdavLockRequest::TYPE_WRITE,
+ ezcWebdavLockRequest::SCOPE_SHARED
+ ),
+ )
+ )
+ );
+
+ return $test->backend;
+ }
+
protected static function getIcsUciSetup1( ezcWebdavClientTest $test )
{
$test->backend = new ezcWebdavMemoryBackend();
--
svn-components mailing list
[email protected]
http://lists.ez.no/mailman/listinfo/svn-components