function testComplexIf()
 {
     $serverVars = array('HTTP_IF' => '<http://www.example.org/node1> (<opaquelocktoken:token1> [etag1]) ' . '(Not <opaquelocktoken:token2>) ([etag2]) <http://www.example.org/node2> ' . '(<opaquelocktoken:token3>) (Not <opaquelocktoken:token4>) ([etag3])');
     $request = new Sabre_HTTP_Request($serverVars);
     $this->server->httpRequest = $request;
     $conditions = $this->locksPlugin->getIfConditions();
     $compare = array(array('uri' => 'http://www.example.org/node1', 'tokens' => array(array(1, 'opaquelocktoken:token1', 'etag1'), array(0, 'opaquelocktoken:token2', ''), array(1, '', 'etag2'))), array('uri' => 'http://www.example.org/node2', 'tokens' => array(array(1, 'opaquelocktoken:token3', ''), array(0, 'opaquelocktoken:token4', ''), array(1, '', 'etag3'))));
     $this->assertEquals($compare, $conditions);
 }
示例#2
0
 /**
  * @expectedException Sabre_DAV_Exception_BadRequest
  */
 function testGetTimeoutHeaderInvalid()
 {
     $request = new Sabre_HTTP_Request(array('HTTP_TIMEOUT' => 'yourmom'));
     $this->server->httpRequest = $request;
     $this->locksPlugin->getTimeoutHeader();
 }