public function testRefreshLock() { DAV::$LOCKPROVIDER = $this->getMock('DAV_Test_Lock_Provider', array('getlock')); DAV::$LOCKPROVIDER->expects($this->any())->method('getlock')->will($this->returnValue(new DAV_Element_activelock(array('lockroot' => $_SERVER['REQUEST_URI'], 'depth' => '0', 'locktoken' => 'urn:uuid:e71d4fae-5dec-22d6-fea5-00a0c91e6be4', 'owner' => 'somebody', 'timeout' => 'seconds-1234')))); $_SERVER['HTTP_IF'] = '(<urn:uuid:e71d4fae-5dec-22d6-fea5-00a0c91e6be4>)'; $this->expectOutputString(<<<EOS Content-Type: application/xml; charset="utf-8" <?xml version="1.0" encoding="utf-8"?> <D:prop xmlns:D="DAV:"><D:lockdiscovery><D:activelock> <D:lockscope><D:exclusive/></D:lockscope> <D:locktype><D:write/></D:locktype> <D:depth>0</D:depth> <D:owner>somebody</D:owner> <D:timeout>Second-0</D:timeout> <D:locktoken> <D:href>urn:uuid:e71d4fae-5dec-22d6-fea5-00a0c91e6be4</D:href> </D:locktoken> <D:lockroot><D:href>/path/to/resource</D:href></D:lockroot> </D:activelock></D:lockdiscovery></D:prop> EOS ); DAV_Test_Request_LOCK::setInputstring(''); $obj = DAV_Test_Request_LOCK::inst(); $obj->handleRequest(); }
public static function setInputstring($inputstring) { self::$inputstring = $inputstring; }