public function setUp() { $properties = new PropertySet(); $properties['D:displayname'] = 'Example collection'; $properties->add(new DateTimeProperty('D:creationdate', '1997-12-01T17:42:21-08:00')); $properties->add(new ResourceType('collection')); $lockCapabilities = new SupportedLock(array('write' => array('exclusive', 'shared'))); $properties->add($lockCapabilities); $this->collection = new Resource('http://www.foo.bar/container/', $properties); $resourceProps = new PropertySet(); $resourceProps['D:displayname'] = 'Example HTML resource'; $resourceProps['D:getcontentlength'] = 4525; $resourceProps['D:getcontenttype'] = 'text/html'; $resourceProps['D:getcontentlanguage'] = 'en'; $resourceProps['D:getetag'] = 'zzyzx'; $resourceProps->add(new DateTimeProperty('D:creationdate', '1997-12-01T18:27:21-08:00')); $resourceProps->add(new DateTimeProperty('D:getlastmodified', 'Monday, 12-Jan-98 09:25:56 GMT')); $resourceProps->add(new ResourceType()); $resourceProps->add(new SupportedLock(array('write' => array('exclusive', 'shared')))); $this->lock = new Lock(); $this->lock->setDepth(-1); $this->lock->setTimeout(604800); $this->lock->setOwner('http://www.ics.uci.edu/~ejw/contact.html'); $this->lock->setToken('opaquelocktoken:e71d4fae-5dec-22d6-fea5-00a0c91e6be4'); $resourceProps->add(new LockDiscovery(array($this->lock))); $this->resource = new Resource('http://www.foo.bar/container/front.html', $resourceProps); }
/** * @expectedException \InvalidArgumentException * @expectedExceptionMessage Values other than 0 or infinity MUST NOT be used with the Depth header on a lock */ public function testInvalidDepth() { $this->lock->setDepth(1); }