public function testPurgePartlyOutdatedCollectionLockedComplex()
 {
     $expectedLockDiscoveryParent = new ezcWebdavLockDiscoveryProperty(new ArrayObject(array(new ezcWebdavLockDiscoveryPropertyActiveLock(ezcWebdavLockRequest::TYPE_WRITE, ezcWebdavLockRequest::SCOPE_SHARED, ezcWebdavRequest::DEPTH_ZERO, new ezcWebdavPotentialUriContent('http://example.com/some_user', true), 300, new ezcWebdavPotentialUriContent('opaquelocktoken:1234', true), null, new ezcWebdavDateTime()))));
     $expectedLockDiscoveryChild = new ezcWebdavLockDiscoveryProperty();
     $actualLockDiscoveryParent = clone $expectedLockDiscoveryParent;
     $actualLockDiscoveryParent->activeLock->append(new ezcWebdavLockDiscoveryPropertyActiveLock(ezcWebdavLockRequest::TYPE_WRITE, ezcWebdavLockRequest::SCOPE_SHARED, ezcWebdavRequest::DEPTH_INFINITY, new ezcWebdavPotentialUriContent('http://example.com/some_user', true), 300, new ezcWebdavPotentialUriContent('opaquelocktoken:5678', true), null, new ezcWebdavDateTime('@' . (time() - 600))));
     $actualLockDiscoveryChild = clone $actualLockDiscoveryParent;
     $actualLockDiscoveryChild->activeLock->offsetUnset(0);
     $actualLockDiscoveryChild->activeLock->offsetGet(1)->lastAccess = null;
     $actualLockDiscoveryChild->activeLock->offsetGet(1)->baseUri = '/collection';
     $expectedBackend = clone $this->backend;
     $expectedBackend->setProperty('/collection', $expectedLockDiscoveryParent);
     $expectedBackend->setProperty('/collection/res_1', $expectedLockDiscoveryChild);
     $this->backend->setProperty('/collection', $actualLockDiscoveryParent);
     $this->backend->setProperty('/collection/res_1', $actualLockDiscoveryChild);
     $admin = new ezcWebdavLockAdministrator($this->backend);
     $admin->purgeLocks('/collection');
     $this->assertEquals($expectedBackend, $this->backend);
 }
<?php

require_once 'tutorial_autoload.php';
require_once 'custom_lock_auth.php';
$server = ezcWebdavServer::getInstance();
$server->pluginRegistry->registerPlugin(new ezcWebdavLockPluginConfiguration());
$backend = new ezcWebdavFileBackend(dirname(__FILE__) . '/backend');
$administrator = new ezcWebdavLockAdministrator($backend);
$administrator->purgeLocks();