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

Public Member Functions

 setUp ()
 
 testPassThrough ()
 
 testMountResponse ()
 
- Public Member Functions inherited from Sabre\DAV\AbstractServer
 setUp ()
 
 tearDown ()
 

Additional Inherited Members

- Protected Member Functions inherited from Sabre\DAV\AbstractServer
 getRootNode ()
 
- Protected Attributes inherited from Sabre\DAV\AbstractServer
 $response
 
 $request
 
 $server
 
 $tempDir = SABRE_TEMPDIR
 

Detailed Description

Definition at line 10 of file PluginTest.php.

Member Function Documentation

◆ setUp()

Sabre\DAV\Mount\PluginTest::setUp ( )

Definition at line 12 of file PluginTest.php.

12  {
13 
14  parent::setUp();
15  $this->server->addPlugin(new Plugin());
16 
17  }

◆ testMountResponse()

Sabre\DAV\Mount\PluginTest::testMountResponse ( )

Definition at line 34 of file PluginTest.php.

References Sabre\DAV\AbstractServer\$request, $url, $xml, and Sabre\HTTP\Sapi\createFromServerArray().

34  {
35 
36  $serverVars = [
37  'REQUEST_URI' => '/?mount',
38  'REQUEST_METHOD' => 'GET',
39  'QUERY_STRING' => 'mount',
40  'HTTP_HOST' => 'example.org',
41  ];
42 
44  $this->server->httpRequest = ($request);
45  $this->server->exec();
46 
47  $this->assertEquals(200, $this->response->status);
48 
49  $xml = simplexml_load_string($this->response->body);
50  $this->assertInstanceOf('SimpleXMLElement', $xml, 'Response was not a valid xml document. The list of errors:' . print_r(libxml_get_errors(), true) . '. xml body: ' . $this->response->body . '. What type we got: ' . gettype($xml) . ' class, if object: ' . get_class($xml));
51 
52  $xml->registerXPathNamespace('dm', 'http://purl.org/NET/webdav/mount');
53  $url = $xml->xpath('//dm:url');
54  $this->assertEquals('http://example.org/', (string)$url[0]);
55 
56  }
$url
static createFromServerArray(array $serverArray)
This static method will create a new Request object, based on a PHP $_SERVER array.
Definition: Sapi.php:107
+ Here is the call graph for this function:

◆ testPassThrough()

Sabre\DAV\Mount\PluginTest::testPassThrough ( )

Definition at line 19 of file PluginTest.php.

References Sabre\DAV\AbstractServer\$request, and Sabre\HTTP\Sapi\createFromServerArray().

19  {
20 
21  $serverVars = [
22  'REQUEST_URI' => '/',
23  'REQUEST_METHOD' => 'GET',
24  ];
25 
27  $this->server->httpRequest = ($request);
28  $this->server->exec();
29 
30  $this->assertEquals(501, $this->response->status, 'We expected GET to not be implemented for Directories. Response body: ' . $this->response->body);
31 
32  }
static createFromServerArray(array $serverArray)
This static method will create a new Request object, based on a PHP $_SERVER array.
Definition: Sapi.php:107
+ Here is the call graph for this function:

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