ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
Sabre\DAV\HttpDeleteTest Class Reference

Tests related to the PUT request. More...

+ Inheritance diagram for Sabre\DAV\HttpDeleteTest:
+ Collaboration diagram for Sabre\DAV\HttpDeleteTest:

Public Member Functions

 setUpTree ()
 Sets up the DAV tree. More...
 
 testDelete ()
 A successful DELETE. More...
 
 testDeleteDirectory ()
 Deleting a Directory. More...
 
 testDeleteNotFound ()
 DELETE on a node that does not exist. More...
 
 testDeletePreconditions ()
 DELETE with preconditions. More...
 
 testDeletePreconditionsFailed ()
 DELETE with incorrect preconditions. 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)
 

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

Tests related to the PUT request.

Author
Evert Pot (http://evertpot.com/) @license http://sabre.io/license/ Modified BSD License

Definition at line 15 of file HttpDeleteTest.php.

Member Function Documentation

◆ setUpTree()

Sabre\DAV\HttpDeleteTest::setUpTree ( )

Sets up the DAV tree.

Returns
void

Reimplemented from Sabre\DAVServerTest.

Definition at line 22 of file HttpDeleteTest.php.

22 {
23
24 $this->tree = new Mock\Collection('root', [
25 'file1' => 'foo',
26 'dir' => [
27 'subfile' => 'bar',
28 'subfile2' => 'baz',
29 ],
30 ]);
31
32 }

◆ testDelete()

Sabre\DAV\HttpDeleteTest::testDelete ( )

A successful DELETE.

Definition at line 37 of file HttpDeleteTest.php.

37 {
38
39 $request = new HTTP\Request('DELETE', '/file1');
40
41 $response = $this->request($request);
42
43 $this->assertEquals(
44 204,
45 $response->getStatus(),
46 "Incorrect status code. Response body: " . $response->getBodyAsString()
47 );
48
49 $this->assertEquals(
50 [
51 'X-Sabre-Version' => [Version::VERSION],
52 'Content-Length' => ['0'],
53 ],
54 $response->getHeaders()
55 );
56
57 }
foreach($paths as $path) $request
Definition: asyncclient.php:32
request($request, $expectedStatus=null)
Makes a request, and returns a response object.
const VERSION
Full version number.
Definition: Version.php:17
$response

References $request, $response, Sabre\DAVServerTest\request(), and Sabre\DAV\Version\VERSION.

+ Here is the call graph for this function:

◆ testDeleteDirectory()

Sabre\DAV\HttpDeleteTest::testDeleteDirectory ( )

Deleting a Directory.

Definition at line 62 of file HttpDeleteTest.php.

62 {
63
64 $request = new HTTP\Request('DELETE', '/dir');
65
66 $response = $this->request($request);
67
68 $this->assertEquals(
69 204,
70 $response->getStatus(),
71 "Incorrect status code. Response body: " . $response->getBodyAsString()
72 );
73
74 $this->assertEquals(
75 [
76 'X-Sabre-Version' => [Version::VERSION],
77 'Content-Length' => ['0'],
78 ],
79 $response->getHeaders()
80 );
81
82 }

References $request, $response, Sabre\DAVServerTest\request(), and Sabre\DAV\Version\VERSION.

+ Here is the call graph for this function:

◆ testDeleteNotFound()

Sabre\DAV\HttpDeleteTest::testDeleteNotFound ( )

DELETE on a node that does not exist.

Definition at line 87 of file HttpDeleteTest.php.

87 {
88
89 $request = new HTTP\Request('DELETE', '/file2');
90 $response = $this->request($request);
91
92 $this->assertEquals(
93 404,
94 $response->getStatus(),
95 "Incorrect status code. Response body: " . $response->getBodyAsString()
96 );
97
98 }

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

+ Here is the call graph for this function:

◆ testDeletePreconditions()

Sabre\DAV\HttpDeleteTest::testDeletePreconditions ( )

DELETE with preconditions.

Definition at line 103 of file HttpDeleteTest.php.

103 {
104
105 $request = new HTTP\Request('DELETE', '/file1', [
106 'If-Match' => '"' . md5('foo') . '"',
107 ]);
108
109 $response = $this->request($request);
110
111 $this->assertEquals(
112 204,
113 $response->getStatus(),
114 "Incorrect status code. Response body: " . $response->getBodyAsString()
115 );
116
117 }

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

+ Here is the call graph for this function:

◆ testDeletePreconditionsFailed()

Sabre\DAV\HttpDeleteTest::testDeletePreconditionsFailed ( )

DELETE with incorrect preconditions.

Definition at line 122 of file HttpDeleteTest.php.

122 {
123
124 $request = new HTTP\Request('DELETE', '/file1', [
125 'If-Match' => '"' . md5('bar') . '"',
126 ]);
127
128 $response = $this->request($request);
129
130 $this->assertEquals(
131 412,
132 $response->getStatus(),
133 "Incorrect status code. Response body: " . $response->getBodyAsString()
134 );
135
136 }

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

+ Here is the call graph for this function:

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