Definition at line 10 of file PluginTest.php.
◆ setUp()
Sabre\DAV\Mount\PluginTest::setUp |
( |
| ) |
|
Definition at line 12 of file PluginTest.php.
15 $this->server->addPlugin(
new Plugin());
◆ 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().
37 'REQUEST_URI' =>
'/?mount',
38 'REQUEST_METHOD' =>
'GET',
39 'QUERY_STRING' =>
'mount',
40 'HTTP_HOST' =>
'example.org',
44 $this->server->httpRequest = (
$request);
45 $this->server->exec();
47 $this->assertEquals(200, $this->response->status);
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));
52 $xml->registerXPathNamespace(
'dm',
'http://purl.org/NET/webdav/mount');
54 $this->assertEquals(
'http://example.org/', (
string)
$url[0]);
static createFromServerArray(array $serverArray)
This static method will create a new Request object, based on a PHP $_SERVER array.
◆ testPassThrough()
Sabre\DAV\Mount\PluginTest::testPassThrough |
( |
| ) |
|
Definition at line 19 of file PluginTest.php.
References Sabre\DAV\AbstractServer\$request, and Sabre\HTTP\Sapi\createFromServerArray().
23 'REQUEST_METHOD' =>
'GET',
27 $this->server->httpRequest = (
$request);
28 $this->server->exec();
30 $this->assertEquals(501, $this->response->status,
'We expected GET to not be implemented for Directories. Response body: ' . $this->response->body);
static createFromServerArray(array $serverArray)
This static method will create a new Request object, based on a PHP $_SERVER array.
The documentation for this class was generated from the following file: