7 require_once
'Sabre/HTTP/ResponseMock.php';
8 require_once
'Sabre/DAV/AbstractServer.php';
16 $conditions = $this->server->getIfConditions(
$request);
17 $this->assertEquals([], $conditions);
23 $request =
new HTTP\Request(
'GET',
'/path/', [
'If' =>
'(<opaquelocktoken:token1>)']);
24 $conditions = $this->server->getIfConditions(
$request);
33 'token' =>
'opaquelocktoken:token1',
42 $this->assertEquals($compare, $conditions);
49 'HTTP_IF' =>
'(Not <opaquelocktoken:token1>)',
50 'REQUEST_URI' =>
'/bla' 54 $conditions = $this->server->getIfConditions(
$request);
63 'token' =>
'opaquelocktoken:token1',
71 $this->assertEquals($compare, $conditions);
78 'HTTP_IF' =>
'<http://www.example.com/> (<opaquelocktoken:token1>)',
82 $conditions = $this->server->getIfConditions(
$request);
91 'token' =>
'opaquelocktoken:token1',
99 $this->assertEquals($compare, $conditions);
106 'HTTP_IF' =>
'(<opaquelocktoken:token1>) (Not <opaquelocktoken:token2>)',
107 'REQUEST_URI' =>
'/bla',
111 $conditions = $this->server->getIfConditions(
$request);
120 'token' =>
'opaquelocktoken:token1',
125 'token' =>
'opaquelocktoken:token2',
133 $this->assertEquals($compare, $conditions);
140 'HTTP_IF' =>
'<http://www.example.org/node1> (<opaquelocktoken:token1>) <http://www.example.org/node2> (Not <opaquelocktoken:token2>)',
144 $conditions = $this->server->getIfConditions(
$request);
153 'token' =>
'opaquelocktoken:token1',
163 'token' =>
'opaquelocktoken:token2',
171 $this->assertEquals($compare, $conditions);
178 'HTTP_IF' =>
'<http://www.example.org/node1> (<opaquelocktoken:token1>) (<opaquelocktoken:token2>) <http://www.example.org/node2> (Not <opaquelocktoken:token3>)',
182 $conditions = $this->server->getIfConditions(
$request);
191 'token' =>
'opaquelocktoken:token1',
196 'token' =>
'opaquelocktoken:token2',
206 'token' =>
'opaquelocktoken:token3',
214 $this->assertEquals($compare, $conditions);
221 'HTTP_IF' =>
'(["etag1"])',
222 'REQUEST_URI' =>
'/foo',
226 $conditions = $this->server->getIfConditions(
$request);
242 $this->assertEquals($compare, $conditions);
249 'HTTP_IF' =>
'<http://www.example.org/> (["etag1"]) (["etag2"])',
253 $conditions = $this->server->getIfConditions(
$request);
274 $this->assertEquals($compare, $conditions);
281 'HTTP_IF' =>
'<http://www.example.org/node1> (<opaquelocktoken:token1> ["etag1"]) ' .
282 '(Not <opaquelocktoken:token2>) (["etag2"]) <http://www.example.org/node2> ' .
283 '(<opaquelocktoken:token3>) (Not <opaquelocktoken:token4>) (["etag3"])',
287 $conditions = $this->server->getIfConditions(
$request);
296 'token' =>
'opaquelocktoken:token1',
301 'token' =>
'opaquelocktoken:token2',
316 'token' =>
'opaquelocktoken:token3',
321 'token' =>
'opaquelocktoken:token4',
333 $this->assertEquals($compare, $conditions);
test2UriMultiLockTokens()
static createFromServerArray(array $serverArray)
This static method will create a new Request object, based on a PHP $_SERVER array.