Exemple #1
0
    /**
     * @depends testLock
     */
    function testLockRetainOwner()
    {
        $request = HTTP\Sapi::createFromServerArray(['REQUEST_URI' => '/test.txt', 'REQUEST_METHOD' => 'LOCK']);
        $this->server->httpRequest = $request;
        $request->setBody('<?xml version="1.0"?>
<D:lockinfo xmlns:D="DAV:">
    <D:lockscope><D:exclusive/></D:lockscope>
    <D:locktype><D:write/></D:locktype>
    <D:owner>Evert</D:owner>
</D:lockinfo>');
        $this->server->invokeMethod($request, $this->server->httpResponse);
        $lockToken = $this->server->httpResponse->getHeader('Lock-Token');
        $locks = $this->locksPlugin->getLocks('test.txt');
        $this->assertEquals(1, count($locks));
        $this->assertEquals('Evert', $locks[0]->owner);
    }
Exemple #2
0
    /**
     * @depends testLock
     */
    function testLockRetainOwner()
    {
        $request = new HTTP\Request(array());
        $this->server->httpRequest = $request;
        $request->setBody('<?xml version="1.0"?>
<D:lockinfo xmlns:D="DAV:">
    <D:lockscope><D:exclusive/></D:lockscope>
    <D:locktype><D:write/></D:locktype>
    <D:owner>Evert</D:owner>
</D:lockinfo>');
        $this->server->invokeMethod('LOCK', 'test.txt');
        $lockToken = $this->server->httpResponse->headers['Lock-Token'];
        $locks = $this->locksPlugin->getLocks('test.txt');
        $this->assertEquals(1, count($locks));
        $this->assertEquals('Evert', $locks[0]->owner);
    }