public function assertTargetStillLocked(ezcWebdavMemoryBackend $backend) { $prop = $backend->getProperty('/collection/resource.html', 'lockdiscovery'); PHPUnit_Framework_Assert::assertNotNull($prop, 'Lock discovery property removed from target.'); PHPUnit_Framework_Assert::assertEquals(1, count($prop->activeLock), 'Target parent active lock gone.'); PHPUnit_Framework_Assert::assertEquals('opaquelocktoken:1234', $prop->activeLock[0]->token->__toString()); }
public function assertDestinationCorrect(ezcWebdavMemoryBackend $backend) { PHPUnit_Framework_Assert::assertTrue($backend->nodeExists('/other_collection/moved_resource.html')); $prop = $backend->getProperty('/other_collection/moved_resource.html', 'lockdiscovery'); PHPUnit_Framework_Assert::assertNotNull($prop, 'Lock discovery property not available on destination.'); PHPUnit_Framework_Assert::assertEquals(0, count($prop->activeLock), 'Active lock available on destination.'); }
public function assertLockDiscoveryPropertyNowhere(ezcWebdavMemoryBackend $backend) { $prop = $backend->getProperty('/collection', 'lockdiscovery'); PHPUnit_Framework_Assert::assertNull($prop); $prop = $backend->getProperty('/collection/resource.html', 'lockdiscovery'); PHPUnit_Framework_Assert::assertType('ezcWebdavLockDiscoveryProperty', $prop, 'Property has incorrect type.'); PHPUnit_Framework_Assert::assertEquals(0, count($prop->activeLock), 'Active lock element not removed correctly.'); }
public function assertDestinationCorrect(ezcWebdavMemoryBackend $backend) { PHPUnit_Framework_Assert::assertTrue($backend->nodeExists('/other_collection/moved_resource.html')); $prop = $backend->getProperty('/other_collection/moved_resource.html', 'lockdiscovery'); PHPUnit_Framework_Assert::assertNotNull($prop, 'Lock discovery property not available on destination.'); PHPUnit_Framework_Assert::assertType('ezcWebdavLockDiscoveryProperty', $prop); PHPUnit_Framework_Assert::assertEquals(1, count($prop->activeLock), 'Active lock element not available on destination.'); PHPUnit_Framework_Assert::assertEquals('opaquelocktoken:5678', $prop->activeLock[0]->token->__toString(), 'Active lock token on destination incorrect.'); }
public function assertLockDiscoveryPropertyStillCorrect(ezcWebdavMemoryBackend $backend) { $prop = $backend->getProperty('/collection', 'lockdiscovery'); PHPUnit_Framework_Assert::assertInstanceOf('ezcWebdavLockDiscoveryProperty', $prop, 'Property has incorrect type.'); PHPUnit_Framework_Assert::assertEquals(0, count($prop->activeLock), 'Active lock element not removed correctly from root.'); $prop = $backend->getProperty('/collection/resource.html', 'lockdiscovery'); PHPUnit_Framework_Assert::assertInstanceOf('ezcWebdavLockDiscoveryProperty', $prop, 'Property has incorrect type.'); PHPUnit_Framework_Assert::assertEquals(1, count($prop->activeLock), 'Active lock element not present in null resource anymore.'); }
function assertLockDiscoveryPropertyCorrect(ezcWebdavMemoryBackend $backend) { $prop = $backend->getProperty('/collection', 'lockdiscovery'); PHPUnit_Framework_Assert::assertNotNull($prop, 'Lock discovery property not set.'); PHPUnit_Framework_Assert::assertInstanceOf('ezcWebdavLockDiscoveryProperty', $prop, 'Lock discovery property has incorrect type.'); PHPUnit_Framework_Assert::assertEquals(1, count($prop->activeLock), 'Number of activeLock elements incorrect.'); PHPUnit_Framework_Assert::assertEquals(new ezcWebdavPotentialUriContent('http://example.com/some/user', true), $prop->activeLock[0]->owner, 'Lock owner not correct.'); $prop = $backend->getProperty('/collection/resource.html', 'lockdiscovery'); PHPUnit_Framework_Assert::assertNotNull($prop, 'Lock discovery property not set.'); PHPUnit_Framework_Assert::assertInstanceOf('ezcWebdavLockDiscoveryProperty', $prop, 'Lock discovery property has incorrect type.'); PHPUnit_Framework_Assert::assertEquals(1, count($prop->activeLock), 'Number of activeLock elements incorrect.'); PHPUnit_Framework_Assert::assertEquals(new ezcWebdavPotentialUriContent('http://example.com/some/user', true), $prop->activeLock[0]->owner, 'Lock owner not correct.'); }
public function assertLockDiscoveryPropertyNowhereElse(ezcWebdavMemoryBackend $backend) { $prop = $backend->getProperty('/collection', 'lockdiscovery'); PHPUnit_Framework_Assert::assertNull($prop); }
<?php return array(0 => ezcWebdavRequestNotSupportedException::__set_state(array('originalMessage' => 'The request type \'ezcWebdavLockRequest\' is not supported by the transport. Backend could not dispatch request object.', 'message' => 'The request type \'ezcWebdavLockRequest\' is not supported by the transport. Backend could not dispatch request object.', 'string' => '', 'code' => 0, 'file' => '/home/dotxp/dev/ez/ezcomponents/trunk/Webdav/src/interfaces/backend.php', 'line' => 158, 'trace' => array(0 => array('file' => '/home/dotxp/dev/ez/ezcomponents/trunk/Webdav/src/server.php', 'line' => 126, 'function' => 'performRequest', 'class' => 'ezcWebdavBackend', 'type' => '->', 'args' => array(0 => ezcWebdavLockRequest::__set_state(array('properties' => array('requestUri' => '/litmus/lockme', 'lockInfo' => ezcWebdavRequestLockInfoContent::__set_state(array('properties' => array('lockScope' => 2, 'lockType' => 2, 'owner' => 'litmus test suite'), 'pluginData' => array()))), 'headers' => array('Depth' => 0, 'Timeout' => 'Second-3600'), 'validated' => true)))), 1 => array('file' => '/home/dotxp/dev/ez/ezcomponents/trunk/Webdav/tests/scripts/test_generator.php', 'line' => 193, 'function' => 'handle', 'class' => 'ezcWebdavServer', 'type' => '->', 'args' => array(0 => ezcWebdavMemoryBackend::__set_state(array('options' => ezcWebdavMemoryBackendOptions::__set_state(array('properties' => array('failForRegexp' => NULL, 'failingOperations' => 0))), 'content' => array('/' => array(0 => '/collection', 1 => '/file.xml', 2 => '/file.bin', 3 => '/litmus'), '/collection' => array(0 => '/collection/file.txt', 1 => '/collection/subdir'), '/collection/file.txt' => 'Some text content.', '/collection/subdir' => array(0 => '/collection/subdir/file.html', 1 => '/collection/subdir/file.xml'), '/collection/subdir/file.html' => '<html><body><h1>Test</h1></body></html>', '/collection/subdir/file.xml' => '<?xml ?> <content/>', '/file.xml' => '<?xml ?> <content/>', '/file.bin' => '\\000§"$%&', '/litmus' => array(0 => '/litmus/lockme', 1 => '/litmus/notlocked'), '/litmus/lockme' => 'This is a test file called foo ', '/litmus/notlocked' => 'This is a test file called foo '), 'props' => array('/' => ezcWebdavBasicPropertyStorage::__set_state(array('properties' => array('DAV:' => array('creationdate' => ezcWebdavCreationDateProperty::__set_state(array('properties' => array('hasError' => false, 'errors' => array(), 'namespace' => 'DAV:', 'name' => 'creationdate', 'date' => ezcWebdavDateTime::__set_state(array('backupTime' => 'Tue, 27 May 2003 11:27:00 +0000'))), 'pluginData' => array())), 'displayname' => ezcWebdavDisplayNameProperty::__set_state(array('properties' => array('hasError' => false, 'errors' => array(), 'namespace' => 'DAV:', 'name' => 'displayname', 'displayName' => ''), 'pluginData' => array())), 'getcontentlanguage' => ezcWebdavGetContentLanguageProperty::__set_state(array('properties' => array('hasError' => false, 'errors' => array(), 'namespace' => 'DAV:', 'name' => 'getcontentlanguage', 'languages' => array(0 => 'en')), 'pluginData' => array())), 'getcontenttype' => ezcWebdavGetContentTypeProperty::__set_state(array('properties' => array('hasError' => false, 'errors' => array(), 'namespace' => 'DAV:', 'name' => 'getcontenttype', 'mime' => 'httpd/unix-directory', 'charset' => NULL), 'pluginData' => array())), 'getetag' => ezcWebdavGetEtagProperty::__set_state(array('properties' => array('hasError' => false, 'errors' => array(), 'namespace' => 'DAV:', 'name' => 'getetag', 'etag' => '6666cd76f96956469e7be39d750cc7d9'), 'pluginData' => array())), 'getlastmodified' => ezcWebdavGetLastModifiedProperty::__set_state(array('properties' => array('hasError' => false, 'errors' => array(), 'namespace' => 'DAV:', 'name' => 'getlastmodified', 'date' => ezcWebdavDateTime::__set_state(array('backupTime' => 'Mon, 15 Aug 2005 15:13:00 +0000'))), 'pluginData' => array())), 'getcontentlength' => ezcWebdavGetContentLengthProperty::__set_state(array('properties' => array('hasError' => false, 'errors' => array(), 'namespace' => 'DAV:', 'name' => 'getcontentlength', 'length' => '4096'), 'pluginData' => array())), 'resourcetype' => ezcWebdavResourceTypeProperty::__set_state(array('properties' => array('hasError' => false, 'errors' => array(), 'namespace' => 'DAV:', 'name' => 'resourcetype', 'type' => 2), 'pluginData' => array())))), 'propertyOrder' => array(0 => array(0 => 'DAV:', 1 => 'creationdate'), 1 => array(0 => 'DAV:', 1 => 'displayname'), 2 => array(0 => 'DAV:', 1 => 'getcontentlanguage'), 3 => array(0 => 'DAV:', 1 => 'getcontenttype'), 4 => array(0 => 'DAV:', 1 => 'getetag'), 5 => array(0 => 'DAV:', 1 => 'getlastmodified'), 6 => array(0 => 'DAV:', 1 => 'getcontentlength'), 7 => array(0 => 'DAV:', 1 => 'resourcetype')), 'propertyOrderPosition' => 0, 'propertyOrderNextId' => 8)), '/collection' => ezcWebdavBasicPropertyStorage::__set_state(array('properties' => array('DAV:' => array('creationdate' => ezcWebdavCreationDateProperty::__set_state(array('properties' => array('hasError' => false, 'errors' => array(), 'namespace' => 'DAV:', 'name' => 'creationdate', 'date' => ezcWebdavDateTime::__set_state(array('backupTime' => 'Tue, 27 May 2003 11:27:00 +0000'))), 'pluginData' => array())), 'displayname' => ezcWebdavDisplayNameProperty::__set_state(array('properties' => array('hasError' => false, 'errors' => array(), 'namespace' => 'DAV:', 'name' => 'displayname', 'displayName' => 'collection'), 'pluginData' => array())), 'getcontentlanguage' => ezcWebdavGetContentLanguageProperty::__set_state(array('properties' => array('hasError' => false, 'errors' => array(), 'namespace' => 'DAV:', 'name' => 'getcontentlanguage', 'languages' => array(0 => 'en')), 'pluginData' => array())), 'getcontenttype' => ezcWebdavGetContentTypeProperty::__set_state(array('properties' => array('hasError' => false, 'errors' => array(), 'namespace' => 'DAV:', 'name' => 'getcontenttype', 'mime' => 'httpd/unix-directory', 'charset' => NULL), 'pluginData' => array())), 'getetag' => ezcWebdavGetEtagProperty::__set_state(array('properties' => array('hasError' => false, 'errors' => array(), 'namespace' => 'DAV:', 'name' => 'getetag', 'etag' => '9696c0fa460d4ed148cb40b2e8388c1e'), 'pluginData' => array())), 'getlastmodified' => ezcWebdavGetLastModifiedProperty::__set_state(array('properties' => array('hasError' => false, 'errors' => array(), 'namespace' => 'DAV:', 'name' => 'getlastmodified', 'date' => ezcWebdavDateTime::__set_state(array('backupTime' => 'Mon, 15 Aug 2005 15:13:00 +0000'))), 'pluginData' => array())), 'getcontentlength' => ezcWebdavGetContentLengthProperty::__set_state(array('properties' => array('hasError' => false, 'errors' => array(), 'namespace' => 'DAV:', 'name' => 'getcontentlength', 'length' => '4096'), 'pluginData' => array())), 'resourcetype' => ezcWebdavResourceTypeProperty::__set_state(array('properties' => array('hasError' => false, 'errors' => array(), 'namespace' => 'DAV:', 'name' => 'resourcetype', 'type' => 2), 'pluginData' => array())))), 'propertyOrder' => array(0 => array(0 => 'DAV:', 1 => 'creationdate'), 1 => array(0 => 'DAV:', 1 => 'displayname'), 2 => array(0 => 'DAV:', 1 => 'getcontentlanguage'), 3 => array(0 => 'DAV:', 1 => 'getcontenttype'), 4 => array(0 => 'DAV:', 1 => 'getetag'), 5 => array(0 => 'DAV:', 1 => 'getlastmodified'), 6 => array(0 => 'DAV:', 1 => 'getcontentlength'), 7 => array(0 => 'DAV:', 1 => 'resourcetype')), 'propertyOrderPosition' => 0, 'propertyOrderNextId' => 8)), '/collection/file.txt' => ezcWebdavBasicPropertyStorage::__set_state(array('properties' => array('DAV:' => array('creationdate' => ezcWebdavCreationDateProperty::__set_state(array('properties' => array('hasError' => false, 'errors' => array(), 'namespace' => 'DAV:', 'name' => 'creationdate', 'date' => ezcWebdavDateTime::__set_state(array('backupTime' => 'Tue, 27 May 2003 11:27:00 +0000'))), 'pluginData' => array())), 'displayname' => ezcWebdavDisplayNameProperty::__set_state(array('properties' => array('hasError' => false, 'errors' => array(), 'namespace' => 'DAV:', 'name' => 'displayname', 'displayName' => 'file.txt'), 'pluginData' => array())), 'getcontentlanguage' => ezcWebdavGetContentLanguageProperty::__set_state(array('properties' => array('hasError' => false, 'errors' => array(), 'namespace' => 'DAV:', 'name' => 'getcontentlanguage', 'languages' => array(0 => 'en')), 'pluginData' => array())), 'getcontenttype' => ezcWebdavGetContentTypeProperty::__set_state(array('properties' => array('hasError' => false, 'errors' => array(), 'namespace' => 'DAV:', 'name' => 'getcontenttype', 'mime' => 'text/plain', 'charset' => 'utf-8'), 'pluginData' => array())), 'getetag' => ezcWebdavGetEtagProperty::__set_state(array('properties' => array('hasError' => false, 'errors' => array(), 'namespace' => 'DAV:', 'name' => 'getetag', 'etag' => '60c0afeb8f68b1765e13694b5e7c8c3d'), 'pluginData' => array())), 'getlastmodified' => ezcWebdavGetLastModifiedProperty::__set_state(array('properties' => array('hasError' => false, 'errors' => array(), 'namespace' => 'DAV:', 'name' => 'getlastmodified', 'date' => ezcWebdavDateTime::__set_state(array('backupTime' => 'Mon, 15 Aug 2005 15:13:00 +0000'))), 'pluginData' => array())), 'getcontentlength' => ezcWebdavGetContentLengthProperty::__set_state(array('properties' => array('hasError' => false, 'errors' => array(), 'namespace' => 'DAV:', 'name' => 'getcontentlength', 'length' => '18'), 'pluginData' => array())), 'resourcetype' => ezcWebdavResourceTypeProperty::__set_state(array('properties' => array('hasError' => false, 'errors' => array(), 'namespace' => 'DAV:', 'name' => 'resourcetype', 'type' => 1), 'pluginData' => array())))), 'propertyOrder' => array(0 => array(0 => 'DAV:', 1 => 'creationdate'), 1 => array(0 => 'DAV:', 1 => 'displayname'), 2 => array(0 => 'DAV:', 1 => 'getcontentlanguage'), 3 => array(0 => 'DAV:', 1 => 'getcontenttype'), 4 => array(0 => 'DAV:', 1 => 'getetag'), 5 => array(0 => 'DAV:', 1 => 'getlastmodified'), 6 => array(0 => 'DAV:', 1 => 'getcontentlength'), 7 => array(0 => 'DAV:', 1 => 'resourcetype')), 'propertyOrderPosition' => 0, 'propertyOrderNextId' => 8)), '/collection/subdir' => ezcWebdavBasicPropertyStorage::__set_state(array('properties' => array('DAV:' => array('creationdate' => ezcWebdavCreationDateProperty::__set_state(array('properties' => array('hasError' => false, 'errors' => array(), 'namespace' => 'DAV:', 'name' => 'creationdate', 'date' => ezcWebdavDateTime::__set_state(array('backupTime' => 'Tue, 27 May 2003 11:27:00 +0000'))), 'pluginData' => array())), 'displayname' => ezcWebdavDisplayNameProperty::__set_state(array('properties' => array('hasError' => false, 'errors' => array(), 'namespace' => 'DAV:', 'name' => 'displayname', 'displayName' => 'subdir'), 'pluginData' => array())), 'getcontentlanguage' => ezcWebdavGetContentLanguageProperty::__set_state(array('properties' => array('hasError' => false, 'errors' => array(), 'namespace' => 'DAV:', 'name' => 'getcontentlanguage', 'languages' => array(0 => 'en')), 'pluginData' => array())), 'getcontenttype' => ezcWebdavGetContentTypeProperty::__set_state(array('properties' => array('hasError' => false, 'errors' => array(), 'namespace' => 'DAV:', 'name' => 'getcontenttype', 'mime' => 'httpd/unix-directory', 'charset' => NULL), 'pluginData' => array())), 'getetag' => ezcWebdavGetEtagProperty::__set_state(array('properties' => array('hasError' => false, 'errors' => array(), 'namespace' => 'DAV:', 'name' => 'getetag', 'etag' => '2215ad4a0621fe1f07727e8534c54a95'), 'pluginData' => array())), 'getlastmodified' => ezcWebdavGetLastModifiedProperty::__set_state(array('properties' => array('hasError' => false, 'errors' => array(), 'namespace' => 'DAV:', 'name' => 'getlastmodified', 'date' => ezcWebdavDateTime::__set_state(array('backupTime' => 'Mon, 15 Aug 2005 15:13:00 +0000'))), 'pluginData' => array())), 'getcontentlength' => ezcWebdavGetContentLengthProperty::__set_state(array('properties' => array('hasError' => false, 'errors' => array(), 'namespace' => 'DAV:', 'name' => 'getcontentlength', 'length' => '4096'), 'pluginData' => array())), 'resourcetype' => ezcWebdavResourceTypeProperty::__set_state(array('properties' => array('hasError' => false, 'errors' => array(), 'namespace' => 'DAV:', 'name' => 'resourcetype', 'type' => 2), 'pluginData' => array())))), 'propertyOrder' => array(0 => array(0 => 'DAV:', 1 => 'creationdate'), 1 => array(0 => 'DAV:', 1 => 'displayname'), 2 => array(0 => 'DAV:', 1 => 'getcontentlanguage'), 3 => array(0 => 'DAV:', 1 => 'getcontenttype'), 4 => array(0 => 'DAV:', 1 => 'getetag'), 5 => array(0 => 'DAV:', 1 => 'getlastmodified'), 6 => array(0 => 'DAV:', 1 => 'getcontentlength'), 7 => array(0 => 'DAV:', 1 => 'resourcetype')), 'propertyOrderPosition' => 0, 'propertyOrderNextId' => 8)), '/collection/subdir/file.html' => ezcWebdavBasicPropertyStorage::__set_state(array('properties' => array('DAV:' => array('creationdate' => ezcWebdavCreationDateProperty::__set_state(array('properties' => array('hasError' => false, 'errors' => array(), 'namespace' => 'DAV:', 'name' => 'creationdate', 'date' => ezcWebdavDateTime::__set_state(array('backupTime' => 'Tue, 27 May 2003 11:27:00 +0000'))), 'pluginData' => array())), 'displayname' => ezcWebdavDisplayNameProperty::__set_state(array('properties' => array('hasError' => false, 'errors' => array(), 'namespace' => 'DAV:', 'name' => 'displayname', 'displayName' => 'file.html'), 'pluginData' => array())), 'getcontentlanguage' => ezcWebdavGetContentLanguageProperty::__set_state(array('properties' => array('hasError' => false, 'errors' => array(), 'namespace' => 'DAV:', 'name' => 'getcontentlanguage', 'languages' => array(0 => 'en')), 'pluginData' => array())), 'getcontenttype' => ezcWebdavGetContentTypeProperty::__set_state(array('properties' => array('hasError' => false, 'errors' => array(), 'namespace' => 'DAV:', 'name' => 'getcontenttype', 'mime' => 'text/html', 'charset' => 'utf-8'), 'pluginData' => array())), 'getetag' => ezcWebdavGetEtagProperty::__set_state(array('properties' => array('hasError' => false, 'errors' => array(), 'namespace' => 'DAV:', 'name' => 'getetag', 'etag' => '3b191a38c8e5d686506677906f3a4cfd'), 'pluginData' => array())), 'getlastmodified' => ezcWebdavGetLastModifiedProperty::__set_state(array('properties' => array('hasError' => false, 'errors' => array(), 'namespace' => 'DAV:', 'name' => 'getlastmodified', 'date' => ezcWebdavDateTime::__set_state(array('backupTime' => 'Mon, 15 Aug 2005 15:13:00 +0000'))), 'pluginData' => array())), 'getcontentlength' => ezcWebdavGetContentLengthProperty::__set_state(array('properties' => array('hasError' => false, 'errors' => array(), 'namespace' => 'DAV:', 'name' => 'getcontentlength', 'length' => '39'), 'pluginData' => array())), 'resourcetype' => ezcWebdavResourceTypeProperty::__set_state(array('properties' => array('hasError' => false, 'errors' => array(), 'namespace' => 'DAV:', 'name' => 'resourcetype', 'type' => 1), 'pluginData' => array())))), 'propertyOrder' => array(0 => array(0 => 'DAV:', 1 => 'creationdate'), 1 => array(0 => 'DAV:', 1 => 'displayname'), 2 => array(0 => 'DAV:', 1 => 'getcontentlanguage'), 3 => array(0 => 'DAV:', 1 => 'getcontenttype'), 4 => array(0 => 'DAV:', 1 => 'getetag'), 5 => array(0 => 'DAV:', 1 => 'getlastmodified'), 6 => array(0 => 'DAV:', 1 => 'getcontentlength'), 7 => array(0 => 'DAV:', 1 => 'resourcetype')), 'propertyOrderPosition' => 0, 'propertyOrderNextId' => 8)), '/collection/subdir/file.xml' => ezcWebdavBasicPropertyStorage::__set_state(array('properties' => array('DAV:' => array('creationdate' => ezcWebdavCreationDateProperty::__set_state(array('properties' => array('hasError' => false, 'errors' => array(), 'namespace' => 'DAV:', 'name' => 'creationdate', 'date' => ezcWebdavDateTime::__set_state(array('backupTime' => 'Tue, 27 May 2003 11:27:00 +0000'))), 'pluginData' => array())), 'displayname' => ezcWebdavDisplayNameProperty::__set_state(array('properties' => array('hasError' => false, 'errors' => array(), 'namespace' => 'DAV:', 'name' => 'displayname', 'displayName' => 'file.xml'), 'pluginData' => array())), 'getcontentlanguage' => ezcWebdavGetContentLanguageProperty::__set_state(array('properties' => array('hasError' => false, 'errors' => array(), 'namespace' => 'DAV:', 'name' => 'getcontentlanguage', 'languages' => array(0 => 'en')), 'pluginData' => array())), 'getcontenttype' => ezcWebdavGetContentTypeProperty::__set_state(array('properties' => array('hasError' => false, 'errors' => array(), 'namespace' => 'DAV:', 'name' => 'getcontenttype', 'mime' => 'text/xml', 'charset' => 'utf-8'), 'pluginData' => array())), 'getetag' => ezcWebdavGetEtagProperty::__set_state(array('properties' => array('hasError' => false, 'errors' => array(), 'namespace' => 'DAV:', 'name' => 'getetag', 'etag' => '8cc4e8038561985cf9e68ee3e36f8882'), 'pluginData' => array())), 'getlastmodified' => ezcWebdavGetLastModifiedProperty::__set_state(array('properties' => array('hasError' => false, 'errors' => array(), 'namespace' => 'DAV:', 'name' => 'getlastmodified', 'date' => ezcWebdavDateTime::__set_state(array('backupTime' => 'Mon, 15 Aug 2005 15:13:00 +0000'))), 'pluginData' => array())), 'getcontentlength' => ezcWebdavGetContentLengthProperty::__set_state(array('properties' => array('hasError' => false, 'errors' => array(), 'namespace' => 'DAV:', 'name' => 'getcontentlength', 'length' => '19'), 'pluginData' => array())), 'resourcetype' => ezcWebdavResourceTypeProperty::__set_state(array('properties' => array('hasError' => false, 'errors' => array(), 'namespace' => 'DAV:', 'name' => 'resourcetype', 'type' => 1), 'pluginData' => array())))), 'propertyOrder' => array(0 => array(0 => 'DAV:', 1 => 'creationdate'), 1 => array(0 => 'DAV:', 1 => 'displayname'), 2 => array(0 => 'DAV:', 1 => 'getcontentlanguage'), 3 => array(0 => 'DAV:', 1 => 'getcontenttype'), 4 => array(0 => 'DAV:', 1 => 'getetag'), 5 => array(0 => 'DAV:', 1 => 'getlastmodified'), 6 => array(0 => 'DAV:', 1 => 'getcontentlength'), 7 => array(0 => 'DAV:', 1 => 'resourcetype')), 'propertyOrderPosition' => 0, 'propertyOrderNextId' => 8)), '/file.xml' => ezcWebdavBasicPropertyStorage::__set_state(array('properties' => array('DAV:' => array('creationdate' => ezcWebdavCreationDateProperty::__set_state(array('properties' => array('hasError' => false, 'errors' => array(), 'namespace' => 'DAV:', 'name' => 'creationdate', 'date' => ezcWebdavDateTime::__set_state(array('backupTime' => 'Tue, 27 May 2003 11:27:00 +0000'))), 'pluginData' => array())), 'displayname' => ezcWebdavDisplayNameProperty::__set_state(array('properties' => array('hasError' => false, 'errors' => array(), 'namespace' => 'DAV:', 'name' => 'displayname', 'displayName' => 'file.xml'), 'pluginData' => array())), 'getcontentlanguage' => ezcWebdavGetContentLanguageProperty::__set_state(array('properties' => array('hasError' => false, 'errors' => array(), 'namespace' => 'DAV:', 'name' => 'getcontentlanguage', 'languages' => array(0 => 'en')), 'pluginData' => array())), 'getcontenttype' => ezcWebdavGetContentTypeProperty::__set_state(array('properties' => array('hasError' => false, 'errors' => array(), 'namespace' => 'DAV:', 'name' => 'getcontenttype', 'mime' => 'text/xml', 'charset' => 'utf-8'), 'pluginData' => array())), 'getetag' => ezcWebdavGetEtagProperty::__set_state(array('properties' => array('hasError' => false, 'errors' => array(), 'namespace' => 'DAV:', 'name' => 'getetag', 'etag' => 'b0c5faef67f106ef634ad2a82e838b95'), 'pluginData' => array())), 'getlastmodified' => ezcWebdavGetLastModifiedProperty::__set_state(array('properties' => array('hasError' => false, 'errors' => array(), 'namespace' => 'DAV:', 'name' => 'getlastmodified', 'date' => ezcWebdavDateTime::__set_state(array('backupTime' => 'Mon, 15 Aug 2005 15:13:00 +0000'))), 'pluginData' => array())), 'getcontentlength' => ezcWebdavGetContentLengthProperty::__set_state(array('properties' => array('hasError' => false, 'errors' => array(), 'namespace' => 'DAV:', 'name' => 'getcontentlength', 'length' => '19'), 'pluginData' => array())), 'resourcetype' => ezcWebdavResourceTypeProperty::__set_state(array('properties' => array('hasError' => false, 'errors' => array(), 'namespace' => 'DAV:', 'name' => 'resourcetype', 'type' => 1), 'pluginData' => array())))), 'propertyOrder' => array(0 => array(0 => 'DAV:', 1 => 'creationdate'), 1 => array(0 => 'DAV:', 1 => 'displayname'), 2 => array(0 => 'DAV:', 1 => 'getcontentlanguage'), 3 => array(0 => 'DAV:', 1 => 'getcontenttype'), 4 => array(0 => 'DAV:', 1 => 'getetag'), 5 => array(0 => 'DAV:', 1 => 'getlastmodified'), 6 => array(0 => 'DAV:', 1 => 'getcontentlength'), 7 => array(0 => 'DAV:', 1 => 'resourcetype')), 'propertyOrderPosition' => 0, 'propertyOrderNextId' => 8)), '/file.bin' => ezcWebdavBasicPropertyStorage::__set_state(array('properties' => array('DAV:' => array('creationdate' => ezcWebdavCreationDateProperty::__set_state(array('properties' => array('hasError' => false, 'errors' => array(), 'namespace' => 'DAV:', 'name' => 'creationdate', 'date' => ezcWebdavDateTime::__set_state(array('backupTime' => 'Tue, 27 May 2003 11:27:00 +0000'))), 'pluginData' => array())), 'displayname' => ezcWebdavDisplayNameProperty::__set_state(array('properties' => array('hasError' => false, 'errors' => array(), 'namespace' => 'DAV:', 'name' => 'displayname', 'displayName' => 'file.bin'), 'pluginData' => array())), 'getcontentlanguage' => ezcWebdavGetContentLanguageProperty::__set_state(array('properties' => array('hasError' => false, 'errors' => array(), 'namespace' => 'DAV:', 'name' => 'getcontentlanguage', 'languages' => array(0 => 'en')), 'pluginData' => array())), 'getcontenttype' => ezcWebdavGetContentTypeProperty::__set_state(array('properties' => array('hasError' => false, 'errors' => array(), 'namespace' => 'DAV:', 'name' => 'getcontenttype', 'mime' => 'application/octet-stream', 'charset' => 'utf-8'), 'pluginData' => array())), 'getetag' => ezcWebdavGetEtagProperty::__set_state(array('properties' => array('hasError' => false, 'errors' => array(), 'namespace' => 'DAV:', 'name' => 'getetag', 'etag' => '68eab65ab82e7e474811d5d2dd879679'), 'pluginData' => array())), 'getlastmodified' => ezcWebdavGetLastModifiedProperty::__set_state(array('properties' => array('hasError' => false, 'errors' => array(), 'namespace' => 'DAV:', 'name' => 'getlastmodified', 'date' => ezcWebdavDateTime::__set_state(array('backupTime' => 'Mon, 15 Aug 2005 15:13:00 +0000'))), 'pluginData' => array())), 'getcontentlength' => ezcWebdavGetContentLengthProperty::__set_state(array('properties' => array('hasError' => false, 'errors' => array(), 'namespace' => 'DAV:', 'name' => 'getcontentlength', 'length' => '7'), 'pluginData' => array())), 'resourcetype' => ezcWebdavResourceTypeProperty::__set_state(array('properties' => array('hasError' => false, 'errors' => array(), 'namespace' => 'DAV:', 'name' => 'resourcetype', 'type' => 1), 'pluginData' => array())))), 'propertyOrder' => array(0 => array(0 => 'DAV:', 1 => 'creationdate'), 1 => array(0 => 'DAV:', 1 => 'displayname'), 2 => array(0 => 'DAV:', 1 => 'getcontentlanguage'), 3 => array(0 => 'DAV:', 1 => 'getcontenttype'), 4 => array(0 => 'DAV:', 1 => 'getetag'), 5 => array(0 => 'DAV:', 1 => 'getlastmodified'), 6 => array(0 => 'DAV:', 1 => 'getcontentlength'), 7 => array(0 => 'DAV:', 1 => 'resourcetype')), 'propertyOrderPosition' => 0, 'propertyOrderNextId' => 8)), '/litmus' => ezcWebdavBasicPropertyStorage::__set_state(array('properties' => array('DAV:' => array('creationdate' => ezcWebdavCreationDateProperty::__set_state(array('properties' => array('hasError' => false, 'errors' => array(), 'namespace' => 'DAV:', 'name' => 'creationdate', 'date' => ezcWebdavDateTime::__set_state(array('backupTime' => 'Tue, 27 May 2003 11:27:00 +0000'))), 'pluginData' => array())), 'displayname' => ezcWebdavDisplayNameProperty::__set_state(array('properties' => array('hasError' => false, 'errors' => array(), 'namespace' => 'DAV:', 'name' => 'displayname', 'displayName' => 'litmus'), 'pluginData' => array())), 'getcontentlanguage' => ezcWebdavGetContentLanguageProperty::__set_state(array('properties' => array('hasError' => false, 'errors' => array(), 'namespace' => 'DAV:', 'name' => 'getcontentlanguage', 'languages' => array(0 => 'en')), 'pluginData' => array())), 'getcontenttype' => ezcWebdavGetContentTypeProperty::__set_state(array('properties' => array('hasError' => false, 'errors' => array(), 'namespace' => 'DAV:', 'name' => 'getcontenttype', 'mime' => 'httpd/unix-directory', 'charset' => NULL), 'pluginData' => array())), 'getetag' => ezcWebdavGetEtagProperty::__set_state(array('properties' => array('hasError' => false, 'errors' => array(), 'namespace' => 'DAV:', 'name' => 'getetag', 'etag' => 'd5d6179894663c1220b1efc8bf8a06da'), 'pluginData' => array())), 'getlastmodified' => ezcWebdavGetLastModifiedProperty::__set_state(array('properties' => array('hasError' => false, 'errors' => array(), 'namespace' => 'DAV:', 'name' => 'getlastmodified', 'date' => ezcWebdavDateTime::__set_state(array('backupTime' => 'Mon, 15 Aug 2005 15:13:00 +0000'))), 'pluginData' => array())), 'getcontentlength' => ezcWebdavGetContentLengthProperty::__set_state(array('properties' => array('hasError' => false, 'errors' => array(), 'namespace' => 'DAV:', 'name' => 'getcontentlength', 'length' => '4096'), 'pluginData' => array())), 'resourcetype' => ezcWebdavResourceTypeProperty::__set_state(array('properties' => array('hasError' => false, 'errors' => array(), 'namespace' => 'DAV:', 'name' => 'resourcetype', 'type' => 2), 'pluginData' => array())))), 'propertyOrder' => array(0 => array(0 => 'DAV:', 1 => 'creationdate'), 1 => array(0 => 'DAV:', 1 => 'displayname'), 2 => array(0 => 'DAV:', 1 => 'getcontentlanguage'), 3 => array(0 => 'DAV:', 1 => 'getcontenttype'), 4 => array(0 => 'DAV:', 1 => 'getetag'), 5 => array(0 => 'DAV:', 1 => 'getlastmodified'), 6 => array(0 => 'DAV:', 1 => 'getcontentlength'), 7 => array(0 => 'DAV:', 1 => 'resourcetype')), 'propertyOrderPosition' => 0, 'propertyOrderNextId' => 8)), '/litmus/lockme' => ezcWebdavBasicPropertyStorage::__set_state(array('properties' => array('DAV:' => array('creationdate' => ezcWebdavCreationDateProperty::__set_state(array('properties' => array('hasError' => false, 'errors' => array(), 'namespace' => 'DAV:', 'name' => 'creationdate', 'date' => ezcWebdavDateTime::__set_state(array('backupTime' => 'Tue, 27 May 2003 11:27:00 +0000'))), 'pluginData' => array())), 'displayname' => ezcWebdavDisplayNameProperty::__set_state(array('properties' => array('hasError' => false, 'errors' => array(), 'namespace' => 'DAV:', 'name' => 'displayname', 'displayName' => 'lockme'), 'pluginData' => array())), 'getcontentlanguage' => ezcWebdavGetContentLanguageProperty::__set_state(array('properties' => array('hasError' => false, 'errors' => array(), 'namespace' => 'DAV:', 'name' => 'getcontentlanguage', 'languages' => array(0 => 'en')), 'pluginData' => array())), 'getcontenttype' => ezcWebdavGetContentTypeProperty::__set_state(array('properties' => array('hasError' => false, 'errors' => array(), 'namespace' => 'DAV:', 'name' => 'getcontenttype', 'mime' => 'application/octet-stream', 'charset' => NULL), 'pluginData' => array())), 'getetag' => ezcWebdavGetEtagProperty::__set_state(array('properties' => array('hasError' => false, 'errors' => array(), 'namespace' => 'DAV:', 'name' => 'getetag', 'etag' => '0f42e3f43ad7df0654c93aa4505499ba'), 'pluginData' => array())), 'getlastmodified' => ezcWebdavGetLastModifiedProperty::__set_state(array('properties' => array('hasError' => false, 'errors' => array(), 'namespace' => 'DAV:', 'name' => 'getlastmodified', 'date' => ezcWebdavDateTime::__set_state(array('backupTime' => 'Mon, 15 Aug 2005 15:13:00 +0000'))), 'pluginData' => array())), 'getcontentlength' => ezcWebdavGetContentLengthProperty::__set_state(array('properties' => array('hasError' => false, 'errors' => array(), 'namespace' => 'DAV:', 'name' => 'getcontentlength', 'length' => '0'), 'pluginData' => array())), 'resourcetype' => ezcWebdavResourceTypeProperty::__set_state(array('properties' => array('hasError' => false, 'errors' => array(), 'namespace' => 'DAV:', 'name' => 'resourcetype', 'type' => 1), 'pluginData' => array())))), 'propertyOrder' => array(0 => array(0 => 'DAV:', 1 => 'creationdate'), 1 => array(0 => 'DAV:', 1 => 'displayname'), 2 => array(0 => 'DAV:', 1 => 'getcontentlanguage'), 3 => array(0 => 'DAV:', 1 => 'getcontenttype'), 4 => array(0 => 'DAV:', 1 => 'getetag'), 5 => array(0 => 'DAV:', 1 => 'getlastmodified'), 6 => array(0 => 'DAV:', 1 => 'getcontentlength'), 7 => array(0 => 'DAV:', 1 => 'resourcetype')), 'propertyOrderPosition' => 0, 'propertyOrderNextId' => 8)), '/litmus/notlocked' => ezcWebdavBasicPropertyStorage::__set_state(array('properties' => array('DAV:' => array('creationdate' => ezcWebdavCreationDateProperty::__set_state(array('properties' => array('hasError' => false, 'errors' => array(), 'namespace' => 'DAV:', 'name' => 'creationdate', 'date' => ezcWebdavDateTime::__set_state(array('backupTime' => 'Tue, 27 May 2003 11:27:00 +0000'))), 'pluginData' => array())), 'displayname' => ezcWebdavDisplayNameProperty::__set_state(array('properties' => array('hasError' => false, 'errors' => array(), 'namespace' => 'DAV:', 'name' => 'displayname', 'displayName' => 'notlocked'), 'pluginData' => array())), 'getcontentlanguage' => ezcWebdavGetContentLanguageProperty::__set_state(array('properties' => array('hasError' => false, 'errors' => array(), 'namespace' => 'DAV:', 'name' => 'getcontentlanguage', 'languages' => array(0 => 'en')), 'pluginData' => array())), 'getcontenttype' => ezcWebdavGetContentTypeProperty::__set_state(array('properties' => array('hasError' => false, 'errors' => array(), 'namespace' => 'DAV:', 'name' => 'getcontenttype', 'mime' => 'application/octet-stream', 'charset' => NULL), 'pluginData' => array())), 'getetag' => ezcWebdavGetEtagProperty::__set_state(array('properties' => array('hasError' => false, 'errors' => array(), 'namespace' => 'DAV:', 'name' => 'getetag', 'etag' => 'b57e2a2223da0830795fecc2f27eea65'), 'pluginData' => array())), 'getlastmodified' => ezcWebdavGetLastModifiedProperty::__set_state(array('properties' => array('hasError' => false, 'errors' => array(), 'namespace' => 'DAV:', 'name' => 'getlastmodified', 'date' => ezcWebdavDateTime::__set_state(array('backupTime' => 'Mon, 15 Aug 2005 15:13:00 +0000'))), 'pluginData' => array())), 'getcontentlength' => ezcWebdavGetContentLengthProperty::__set_state(array('properties' => array('hasError' => false, 'errors' => array(), 'namespace' => 'DAV:', 'name' => 'getcontentlength', 'length' => '0'), 'pluginData' => array())), 'resourcetype' => ezcWebdavResourceTypeProperty::__set_state(array('properties' => array('hasError' => false, 'errors' => array(), 'namespace' => 'DAV:', 'name' => 'resourcetype', 'type' => 1), 'pluginData' => array())))), 'propertyOrder' => array(0 => array(0 => 'DAV:', 1 => 'creationdate'), 1 => array(0 => 'DAV:', 1 => 'displayname'), 2 => array(0 => 'DAV:', 1 => 'getcontentlanguage'), 3 => array(0 => 'DAV:', 1 => 'getcontenttype'), 4 => array(0 => 'DAV:', 1 => 'getetag'), 5 => array(0 => 'DAV:', 1 => 'getlastmodified'), 6 => array(0 => 'DAV:', 1 => 'getcontentlength'), 7 => array(0 => 'DAV:', 1 => 'resourcetype')), 'propertyOrderPosition' => 0, 'propertyOrderNextId' => 8))), 'fakeLiveProperties' => true)))), 2 => array('file' => '/home/dotxp/web/webdav/htdocs/index.php', 'line' => 14, 'function' => 'run', 'class' => 'ezcWebdavClientTestGenerator', 'type' => '->', 'args' => array())))));
public function testLock() { $backend = new ezcWebdavMemoryBackend(); $backend->options->lockFile = $this->tmp . 'backend.lock'; $backend->lock(1000, 200000); $this->assertFileExists($backend->options->lockFile, 'Lock file not created'); $backend->unlock(); $this->assertFileNotExists($backend->options->lockFile, 'Lock file not removed.'); }
public function assertLockDiscoveryPropertyNowhere(ezcWebdavMemoryBackend $backend) { $prop = $backend->getProperty('/collection', 'lockdiscovery'); PHPUnit_Framework_Assert::assertInstanceOf('ezcWebdavLockDiscoveryProperty', $prop, 'Property has incorrect type.'); PHPUnit_Framework_Assert::assertEquals(0, count($prop->activeLock), 'Active lock element not removed correctly from root.'); }
<?php $backendBefore = new ezcWebdavMemoryBackend(); $backendBefore->addContents(array('collection' => array('resource.html' => ''))); $backendBefore->setProperty('/collection', new ezcWebdavLockDiscoveryProperty()); $backendBefore->setProperty('/collection/resource.html', new ezcWebdavLockDiscoveryProperty()); return $backendBefore;
public function assertLockNullStillExists(ezcWebdavMemoryBackend $backend) { PHPUnit_Framework_Assert::assertTrue($backend->nodeExists('/collection/newcollection')); }
public function assertCollectionNotCreated(ezcWebdavMemoryBackend $backend) { PHPUnit_Framework_Assert::assertFalse($backend->nodeExists('/collection/newcollection')); }
<?php $backend = new ezcWebdavMemoryBackend(true); $backend->addContents(array('collection' => array('file.txt' => 'Some text content.', 'subdir' => array('file.html' => '<html><body><h1>Test</h1></body></html>', 'file.xml' => "<?xml?>\n<content/>")), 'secure_collection' => array('file.txt' => 'Some text content.', 'subdir' => array('file.html' => '<html><body><h1>Test</h1></body></html>', 'file.xml' => "<?xml?>\n<content/>")), 'file.xml' => "<?xml ?>\n<content/>", 'file.bin' => "§\"\$%&")); $backend->setProperty('/collection/file.txt', new ezcWebdavGetContentTypeProperty('text/plain', 'utf-8')); $backend->setProperty('/collection/subdir/file.html', new ezcWebdavGetContentTypeProperty('text/html', 'utf-8')); $backend->setProperty('/collection/subdir/file.xml', new ezcWebdavGetContentTypeProperty('text/xml', 'utf-8')); $backend->setProperty('/file.xml', new ezcWebdavGetContentTypeProperty('text/xml', 'utf-8')); $backend->setProperty('/file.bin', new ezcWebdavGetContentTypeProperty('application/octet-stream', 'utf-8')); $backend->setProperty('/secure_collection/file.txt', new ezcWebdavGetContentTypeProperty('text/plain', 'utf-8')); $backend->setProperty('/secure_collection/subdir/file.html', new ezcWebdavGetContentTypeProperty('text/html', 'utf-8')); $backend->setProperty('/secure_collection/subdir/file.xml', new ezcWebdavGetContentTypeProperty('text/xml', 'utf-8')); return $backend;
<?php $backendBefore = new ezcWebdavMemoryBackend(); $backendBefore->addContents(array('collection' => array('resource.html' => '', 'newcollection' => array()))); $backendBefore->setProperty('/collection', new ezcWebdavLockDiscoveryProperty(new ArrayObject(array(new ezcWebdavLockDiscoveryPropertyActiveLock(ezcWebdavLockRequest::TYPE_WRITE, ezcWebdavLockRequest::SCOPE_EXCLUSIVE, ezcWebdavRequest::DEPTH_ZERO, new ezcWebdavPotentialUriContent('http://example.com/some/user', true), 604800, new ezcWebdavPotentialUriContent('opaquelocktoken:5678', true), null, new ezcWebdavDateTime()))))); $backendBefore->setProperty('/collection/newcollection', new ezcWebdavLockDiscoveryProperty(new ArrayObject(array(new ezcWebdavLockDiscoveryPropertyActiveLock(ezcWebdavLockRequest::TYPE_WRITE, ezcWebdavLockRequest::SCOPE_EXCLUSIVE, ezcWebdavRequest::DEPTH_INFINITY, new ezcWebdavPotentialUriContent('http://example.com/some/user', true), 604800, new ezcWebdavPotentialUriContent('opaquelocktoken:1234', true), null, new ezcWebdavDateTime()))))); return $backendBefore;
public function assertDestinationNotExists(ezcWebdavMemoryBackend $backend) { PHPUnit_Framework_Assert::assertFalse($backend->nodeExists('/other_collection/moved_resource.html')); }
public function assertTargetGone(ezcWebdavMemoryBackend $backend) { PHPUnit_Framework_Assert::assertFalse($backend->nodeExists('/collection')); }
<?php $backendBefore = new ezcWebdavMemoryBackend(); $backendBefore->addContents(array('collection' => array('resource.html' => ''), 'other_collection' => array())); return $backendBefore;
private function getBackend() { $backend = new ezcWebdavMemoryBackend(); $backend->addContents(array('a' => array('a1' => array('a11' => 'a11', 'a12' => 'a12'), 'a2' => 'a2'), 'b' => array('b1' => array('b11' => 'b11', 'b12' => 'b12'), 'b2' => 'b2'), 'c' => array('c1' => array('c11' => 'c11', 'c12' => 'c12'), 'c2' => 'c2'))); return $backend; }
public function assertCollectionLockedFromParent(ezcWebdavMemoryBackend $backend) { $parentProp = $backend->getProperty('/collection', 'lockdiscovery'); $childProp = $backend->getProperty('/collection/newresource', 'lockdiscovery'); PHPUnit_Framework_Assert::assertNotEquals($parentProp, $childProp, 'New collection did inherit parents lock.'); }
public function assertTargetParentStillLocked(ezcWebdavMemoryBackend $backend) { $prop = $backend->getProperty('/collection', 'lockdiscovery'); PHPUnit_Framework_Assert::assertNotNull($prop, 'Lock discovery property removed from source.'); PHPUnit_Framework_Assert::assertEquals(1, count($prop->activeLock), 'Target parent active lock gone.'); }
public function assertTargetPropertyNotSet(ezcWebdavMemoryBackend $backend) { $prop = $backend->getProperty('/collection/resource.html', 'authors', 'http://www.w3.com/standards/z39.50/'); PHPUnit_Framework_Assert::assertNull($prop, 'Desired property not set.'); }
<?php $backend = new ezcWebdavMemoryBackend(); $backend->addContents(array('collection' => array('resource.html' => ''))); return $backend;