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 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); }
/** * @expectedException Sabre\DAV\Exception\BadRequest */ function testGetTimeoutHeaderInvalid() { $request = HTTP\Sapi::createFromServerArray(array('HTTP_TIMEOUT' => 'yourmom')); $this->server->httpRequest = $request; $this->locksPlugin->getTimeoutHeader(); }
/** * @expectedException Sabre\DAV\Exception\BadRequest */ function testGetTimeoutHeaderInvalid() { $request = new HTTP\Request(array('HTTP_TIMEOUT' => 'yourmom')); $this->server->httpRequest = $request; $this->locksPlugin->getTimeoutHeader(); }