Author: kn
Date: Thu Oct 4 10:00:18 2007
New Revision: 6352
Log:
- Got file backend with XML property serialization finally working
Modified:
trunk/Webdav/src/backends/file.php
trunk/Webdav/tests/backend_file_test.php
trunk/Webdav/tests/data/responses/file/testPropFindAllPropsOnCollection.ser
trunk/Webdav/tests/data/responses/file/testPropFindAllPropsOnResource.ser
trunk/Webdav/tests/data/responses/file/testPropFindNamesOnCollectionDepthInfinite.ser
trunk/Webdav/tests/data/responses/file/testPropFindNamesOnCollectionDepthOne.ser
trunk/Webdav/tests/data/responses/file/testPropFindNamesOnCollectionDepthZero.ser
trunk/Webdav/tests/data/responses/file/testPropFindNamesOnResource.ser
trunk/Webdav/tests/data/responses/file/testPropPatchAddPropertyFail_2.ser
trunk/Webdav/tests/data/responses/file/testPropPatchFailOnRemoveProperty_1.ser
trunk/Webdav/tests/data/responses/file/testPropPatchFailOnRemoveProperty_2.ser
Modified: trunk/Webdav/src/backends/file.php
==============================================================================
--- trunk/Webdav/src/backends/file.php [iso-8859-1] (original)
+++ trunk/Webdav/src/backends/file.php [iso-8859-1] Thu Oct 4 10:00:18 2007
@@ -457,7 +457,7 @@
$storage = $this->getPropertyStorage( $resource );
// Attach property to store
- $storage->detach( $property );
+ $storage->detach( $property->name, $property->namespace );
// Store document back
$this->storeProperties( $resource, $storage );
Modified: trunk/Webdav/tests/backend_file_test.php
==============================================================================
--- trunk/Webdav/tests/backend_file_test.php [iso-8859-1] (original)
+++ trunk/Webdav/tests/backend_file_test.php [iso-8859-1] Thu Oct 4 10:00:18
2007
@@ -1425,10 +1425,10 @@
$newProperties = new ezcWebdavFlaggedPropertyStorage();
$newProperties->attach( $p1 = new ezcWebdavDeadProperty(
- 'foo:', 'bar', '<content>some content</content>'
+ 'foo:', 'bar', "<?xml version=\"1.0\"?>\n<bar xmlns=\"foo:\">some
content</bar>\n"
), ezcWebdavPropPatchRequest::SET );
$newProperties->attach( $p2 = new ezcWebdavDeadProperty(
- 'foo:', 'blubb', '<content>some other content</content>'
+ 'foo:', 'blubb', "<?xml version=\"1.0\"?>\n<blubb
xmlns=\"foo:\">some other content</blubb>\n"
), ezcWebdavPropPatchRequest::SET );
$addedProperties = new ezcWebdavBasicPropertyStorage();
@@ -1445,7 +1445,7 @@
new ezcWebdavResource( '/resource' )
),
$response,
- 'Expected response does not match real response.',
+ 'Setting properties on ressource failed.',
0,
20
);
@@ -1468,7 +1468,7 @@
$this->assertEquals(
$expectedResponse,
$response,
- 'Expected response does not match real response.',
+ 'Properties are not available for ressource.',
0,
20
);
@@ -1523,13 +1523,13 @@
// Add properties, but cause errors
$newProperties = new ezcWebdavFlaggedPropertyStorage();
$newProperties->attach( $p_bar = new ezcWebdavDeadProperty(
- 'foo:', 'bar', '<content>some content</content>'
+ 'foo:', 'bar', "<?xml version=\"1.0\"?>\n<bar xmlns=\"foo:\">some
content</bar>\n"
), ezcWebdavPropPatchRequest::SET );
$newProperties->attach( $p_blubb = new ezcWebdavDeadProperty(
- 'foo:', 'blubb', '<content>some other content</content>'
+ 'foo:', 'blubb', "<?xml version=\"1.0\"?>\n<blubb
xmlns=\"foo:\">some other content</blubb>\n"
), ezcWebdavPropPatchRequest::SET );
$newProperties->attach( $p_blah = new ezcWebdavDeadProperty(
- 'foo:', 'blah', '<content>even more content</content>'
+ 'foo:', 'blah', "<?xml version=\"1.0\"?>\n<blah
xmlns=\"foo:\">even more content</blah>\n"
), ezcWebdavPropPatchRequest::SET );
$addedProperties = new ezcWebdavBasicPropertyStorage();
@@ -1560,10 +1560,10 @@
// First add some custom properties.
$newProperties = new ezcWebdavFlaggedPropertyStorage();
$newProperties->attach( $p_bar = new ezcWebdavDeadProperty(
- 'foo:', 'bar', '<content>some content</content>'
+ 'foo:', 'bar', "<?xml version=\"1.0\"?>\n<bar xmlns=\"foo:\">some
content</bar>\n"
), ezcWebdavPropPatchRequest::SET );
$newProperties->attach( $p_blubb = new ezcWebdavDeadProperty(
- 'foo:', 'blubb', '<content>some other content</content>'
+ 'foo:', 'blubb', "<?xml version=\"1.0\"?>\n<blubb
xmlns=\"foo:\">some other content</blubb>\n"
), ezcWebdavPropPatchRequest::SET );
$request = new ezcWebdavPropPatchRequest( '/resource' );
@@ -1576,7 +1576,7 @@
new ezcWebdavResource( '/resource' )
),
$response,
- 'Expected response does not match real response.',
+ 'Setting properties failed.',
0,
20
);
@@ -1598,7 +1598,7 @@
new ezcWebdavResource( '/resource' )
),
$response,
- 'Expected response does not match real response.',
+ 'Deletion of properties failed.',
0,
20
);
@@ -1631,7 +1631,7 @@
$this->assertEquals(
$expectedResponse,
$response,
- 'Expected response does not match real response.',
+ 'Property has not been properly removed.',
0,
20
);
@@ -1644,10 +1644,10 @@
// First add some custom properties.
$newProperties = new ezcWebdavFlaggedPropertyStorage();
$newProperties->attach( $p_bar = new ezcWebdavDeadProperty(
- 'foo:', 'bar', '<content>some content</content>'
+ 'foo:', 'bar', "<?xml version=\"1.0\"?>\n<bar xmlns=\"foo:\">some
content</bar>\n"
), ezcWebdavPropPatchRequest::SET );
$newProperties->attach( $p_blubb = new ezcWebdavDeadProperty(
- 'foo:', 'blubb', '<content>some other content</content>'
+ 'foo:', 'blubb', "<?xml version=\"1.0\"?>\n<blubb
xmlns=\"foo:\">some other content</blubb>\n"
), ezcWebdavPropPatchRequest::SET );
$request = new ezcWebdavPropPatchRequest( '/resource' );
@@ -1706,10 +1706,10 @@
// First add some custom properties.
$newProperties = new ezcWebdavFlaggedPropertyStorage();
$newProperties->attach( $p_bar = new ezcWebdavDeadProperty(
- 'foo:', 'bar', '<content>some content</content>'
+ 'foo:', 'bar', "<?xml version=\"1.0\"?>\n<bar xmlns=\"foo:\">some
content</bar>\n"
), ezcWebdavPropPatchRequest::SET );
$newProperties->attach( $p_blubb = new ezcWebdavDeadProperty(
- 'foo:', 'blubb', '<content>some other content</content>'
+ 'foo:', 'blubb', "<?xml version=\"1.0\"?>\n<blubb
xmlns=\"foo:\">some other content</blubb>\n"
), ezcWebdavPropPatchRequest::SET );
$request = new ezcWebdavPropPatchRequest( '/resource' );
@@ -1732,7 +1732,7 @@
$updateProperties = new ezcWebdavFlaggedPropertyStorage();
$updateProperties->attach( $p_blubb, ezcWebdavPropPatchRequest::REMOVE
);
$updateProperties->attach(
- $p_foo = new ezcWebdavDeadProperty( 'foo:', 'foo',
'<content>random content</content>' ),
+ $p_foo = new ezcWebdavDeadProperty( 'foo:', 'foo', "<?xml
version=\"1.0\"?>\n<foo xmlns=\"foo:\">random content</foo>\n" ),
ezcWebdavPropPatchRequest::SET
);
$updateProperties->attach( $p_bar, ezcWebdavPropPatchRequest::REMOVE );
@@ -1800,10 +1800,10 @@
// First add some custom properties.
$newProperties = new ezcWebdavFlaggedPropertyStorage();
$newProperties->attach( $p_bar = new ezcWebdavDeadProperty(
- 'foo:', 'bar', '<content>some content</content>'
+ 'foo:', 'bar', "<?xml version=\"1.0\"?>\n<bar xmlns=\"foo:\">some
content</bar>\n"
), ezcWebdavPropPatchRequest::SET );
$newProperties->attach( $p_blubb = new ezcWebdavDeadProperty(
- 'foo:', 'blubb', '<content>some other content</content>'
+ 'foo:', 'blubb', "<?xml version=\"1.0\"?>\n<blubb
xmlns=\"foo:\">some other content</blubb>\n"
), ezcWebdavPropPatchRequest::SET );
$request = new ezcWebdavPropPatchRequest( '/resource' );
@@ -1830,7 +1830,7 @@
ezcWebdavPropPatchRequest::REMOVE
);
$updateProperties->attach(
- $p_foo = new ezcWebdavDeadProperty( 'foo:', 'foo',
'<content>random content</content>' ),
+ $p_foo = new ezcWebdavDeadProperty( 'foo:', 'foo', "<?xml
version=\"1.0\"?>\n<foo xmlns=\"foo:\">random content</foo>\n" ),
ezcWebdavPropPatchRequest::SET
);
$updateProperties->attach( $p_bar, ezcWebdavPropPatchRequest::REMOVE );
Modified:
trunk/Webdav/tests/data/responses/file/testPropFindAllPropsOnCollection.ser
==============================================================================
Binary files - no diff available.
Modified:
trunk/Webdav/tests/data/responses/file/testPropFindAllPropsOnResource.ser
==============================================================================
Binary files - no diff available.
Modified:
trunk/Webdav/tests/data/responses/file/testPropFindNamesOnCollectionDepthInfinite.ser
==============================================================================
Binary files - no diff available.
Modified:
trunk/Webdav/tests/data/responses/file/testPropFindNamesOnCollectionDepthOne.ser
==============================================================================
Binary files - no diff available.
Modified:
trunk/Webdav/tests/data/responses/file/testPropFindNamesOnCollectionDepthZero.ser
==============================================================================
Binary files - no diff available.
Modified: trunk/Webdav/tests/data/responses/file/testPropFindNamesOnResource.ser
==============================================================================
Binary files - no diff available.
Modified:
trunk/Webdav/tests/data/responses/file/testPropPatchAddPropertyFail_2.ser
==============================================================================
Binary files - no diff available.
Modified:
trunk/Webdav/tests/data/responses/file/testPropPatchFailOnRemoveProperty_1.ser
==============================================================================
Binary files - no diff available.
Modified:
trunk/Webdav/tests/data/responses/file/testPropPatchFailOnRemoveProperty_2.ser
==============================================================================
Binary files - no diff available.
--
svn-components mailing list
[email protected]
http://lists.ez.no/mailman/listinfo/svn-components