ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
Sabre\DAV\Locks\Plugin2Test Class Reference
+ Inheritance diagram for Sabre\DAV\Locks\Plugin2Test:
+ Collaboration diagram for Sabre\DAV\Locks\Plugin2Test:

Public Member Functions

 setUpTree ()
 
 tearDown ()
 
 testUnlockAfterDelete ()
 This test first creates a file with LOCK and then deletes it. More...
 
- Public Member Functions inherited from Sabre\DAVServerTest
 setUp ()
 
 initializeEverything ()
 
 request ($request, $expectedStatus=null)
 Makes a request, and returns a response object. More...
 
 autoLogin ($userName)
 This function takes a username and sets the server in a state where this user is logged in, and no longer requires an authentication check. More...
 
 setUpTree ()
 Override this to provide your own Tree for your test-case. More...
 
 setUpBackends ()
 
 assertHttpStatus ($expectedStatus, HTTP\Request $req)
 

Data Fields

 $setupLocks = true
 

Additional Inherited Members

- Protected Attributes inherited from Sabre\DAVServerTest
 $setupCalDAV = false
 
 $setupCardDAV = false
 
 $setupACL = false
 
 $setupCalDAVSharing = false
 
 $setupCalDAVScheduling = false
 
 $setupCalDAVSubscriptions = false
 
 $setupCalDAVICSExport = false
 
 $setupLocks = false
 
 $setupFiles = false
 
 $setupSharing = false
 
 $setupPropertyStorage = false
 
 $caldavCalendars = []
 An array with calendars. More...
 
 $caldavCalendarObjects = []
 
 $carddavAddressBooks = []
 
 $carddavCards = []
 
 $server
 
 $tree = []
 
 $caldavBackend
 
 $carddavBackend
 
 $principalBackend
 
 $locksBackend
 
 $propertyStorageBackend
 
 $caldavPlugin
 
 $carddavPlugin
 
 $aclPlugin
 
 $caldavSharingPlugin
 
 $caldavSchedulePlugin
 
 $authPlugin
 
 $locksPlugin
 
 $sharingPlugin
 
 $propertyStoragePlugin
 
 $autoLogin = null
 If this string is set, we will automatically log in the user with this name. More...
 

Detailed Description

Definition at line 7 of file Plugin2Test.php.

Member Function Documentation

◆ setUpTree()

Sabre\DAV\Locks\Plugin2Test::setUpTree ( )

Definition at line 11 of file Plugin2Test.php.

11  {
12 
13  $this->tree = new \Sabre\DAV\FS\Directory(SABRE_TEMPDIR);
14 
15  }

◆ tearDown()

Sabre\DAV\Locks\Plugin2Test::tearDown ( )

Definition at line 17 of file Plugin2Test.php.

References Sabre\TestUtil\clearTempDir().

17  {
18 
20 
21  }
static clearTempDir()
This function deletes all the contents of the temporary directory.
Definition: TestUtil.php:12
+ Here is the call graph for this function:

◆ testUnlockAfterDelete()

Sabre\DAV\Locks\Plugin2Test::testUnlockAfterDelete ( )

This test first creates a file with LOCK and then deletes it.

After deleting the file, the lock should no longer be in the lock backend.

Reported in ticket #487

Definition at line 31 of file Plugin2Test.php.

References $request, $response, Sabre\HTTP\Message\getBodyAsString(), and Sabre\DAVServerTest\request().

31  {
32 
33  $body = '<?xml version="1.0"?>
34 <D:lockinfo xmlns:D="DAV:">
35  <D:lockscope><D:exclusive/></D:lockscope>
36  <D:locktype><D:write/></D:locktype>
37 </D:lockinfo>';
38 
39  $request = new Request(
40  'LOCK',
41  '/file.txt',
42  [],
43  $body
44  );
45  $response = $this->request($request);
46  $this->assertEquals(201, $response->getStatus(), $response->getBodyAsString());
47 
48  $this->assertEquals(
49  1,
50  count($this->locksBackend->getLocks('file.txt', true))
51  );
52 
53  $request = new Request(
54  'DELETE',
55  '/file.txt',
56  [
57  'If' => '(' . $response->getHeader('Lock-Token') . ')',
58  ]
59  );
60  $response = $this->request($request);
61  $this->assertEquals(204, $response->getStatus(), $response->getBodyAsString());
62 
63  $this->assertEquals(
64  0,
65  count($this->locksBackend->getLocks('file.txt', true))
66  );
67  }
foreach($paths as $path) $request
Definition: asyncclient.php:32
request($request, $expectedStatus=null)
Makes a request, and returns a response object.
$response
+ Here is the call graph for this function:

Field Documentation

◆ $setupLocks

Sabre\DAV\Locks\Plugin2Test::$setupLocks = true

Definition at line 9 of file Plugin2Test.php.


The documentation for this class was generated from the following file: