Definition at line 10 of file PluginTest.php.
◆ setUp()
Sabre\DAV\Browser\PluginTest::setUp |
( |
| ) |
|
Definition at line 14 of file PluginTest.php.
17 $this->server->addPlugin($this->plugin =
new Plugin());
18 $this->server->tree->getNodeForPath(
'')->createDirectory(
'dir2');
◆ testCollectionGet()
Sabre\DAV\Browser\PluginTest::testCollectionGet |
( |
| ) |
|
Definition at line 22 of file PluginTest.php.
References Sabre\DAV\AbstractServer\$request, and Sabre\DAV\Version\VERSION.
24 $request =
new HTTP\Request(
'GET',
'/dir');
25 $this->server->httpRequest =
$request;
26 $this->server->exec();
28 $this->assertEquals(200, $this->response->getStatus(),
"Incorrect status received. Full response body: " . $this->response->getBodyAsString());
32 'Content-Type' => [
'text/html; charset=utf-8'],
33 'Content-Security-Policy' => [
"default-src 'none'; img-src 'self'; style-src 'self'; font-src 'self';"]
35 $this->response->getHeaders()
38 $body = $this->response->getBodyAsString();
39 $this->assertTrue(strpos($body,
'<title>dir') !==
false, $body);
40 $this->assertTrue(strpos($body,
'<a href="/dir/child.txt">') !==
false);
const VERSION
Full version number.
◆ testCollectionGetIfNoneMatch()
Sabre\DAV\Browser\PluginTest::testCollectionGetIfNoneMatch |
( |
| ) |
|
Adding the If-None-Match should have 0 effect, but it threw an error.
Definition at line 47 of file PluginTest.php.
References Sabre\DAV\AbstractServer\$request, and Sabre\DAV\Version\VERSION.
49 $request =
new HTTP\Request(
'GET',
'/dir');
50 $request->setHeader(
'If-None-Match',
'"foo-bar"');
51 $this->server->httpRequest =
$request;
52 $this->server->exec();
54 $this->assertEquals(200, $this->response->getStatus(),
"Incorrect status received. Full response body: " . $this->response->getBodyAsString());
58 'Content-Type' => [
'text/html; charset=utf-8'],
59 'Content-Security-Policy' => [
"default-src 'none'; img-src 'self'; style-src 'self'; font-src 'self';"]
61 $this->response->getHeaders()
64 $body = $this->response->getBodyAsString();
65 $this->assertTrue(strpos($body,
'<title>dir') !==
false, $body);
66 $this->assertTrue(strpos($body,
'<a href="/dir/child.txt">') !==
false);
const VERSION
Full version number.
◆ testCollectionGetRoot()
Sabre\DAV\Browser\PluginTest::testCollectionGetRoot |
( |
| ) |
|
Definition at line 69 of file PluginTest.php.
References Sabre\DAV\AbstractServer\$request, and Sabre\DAV\Version\VERSION.
71 $request =
new HTTP\Request(
'GET',
'/');
72 $this->server->httpRequest = (
$request);
73 $this->server->exec();
75 $this->assertEquals(200, $this->response->status,
"Incorrect status received. Full response body: " . $this->response->getBodyAsString());
79 'Content-Type' => [
'text/html; charset=utf-8'],
80 'Content-Security-Policy' => [
"default-src 'none'; img-src 'self'; style-src 'self'; font-src 'self';"]
82 $this->response->getHeaders()
85 $body = $this->response->getBodyAsString();
86 $this->assertTrue(strpos($body,
'<title>/') !==
false, $body);
87 $this->assertTrue(strpos($body,
'<a href="/dir/">') !==
false);
88 $this->assertTrue(strpos($body,
'<span class="btn disabled">') !==
false);
const VERSION
Full version number.
◆ testGetAsset()
Sabre\DAV\Browser\PluginTest::testGetAsset |
( |
| ) |
|
Definition at line 150 of file PluginTest.php.
References Sabre\DAV\AbstractServer\$request, and Sabre\DAV\Version\VERSION.
152 $request =
new HTTP\Request(
'GET',
'/?sabreAction=asset&assetName=favicon.ico');
153 $this->server->httpRequest =
$request;
154 $this->server->exec();
156 $this->assertEquals(200, $this->response->getStatus(),
'Error: ' . $this->response->body);
157 $this->assertEquals([
159 'Content-Type' => [
'image/vnd.microsoft.icon'],
160 'Content-Length' => [
'4286'],
161 'Cache-Control' => [
'public, max-age=1209600'],
162 'Content-Security-Policy' => [
"default-src 'none'; img-src 'self'; style-src 'self'; font-src 'self';"]
163 ], $this->response->getHeaders());
const VERSION
Full version number.
◆ testGetAsset404()
Sabre\DAV\Browser\PluginTest::testGetAsset404 |
( |
| ) |
|
Definition at line 167 of file PluginTest.php.
References Sabre\DAV\AbstractServer\$request.
169 $request =
new HTTP\Request(
'GET',
'/?sabreAction=asset&assetName=flavicon.ico');
170 $this->server->httpRequest =
$request;
171 $this->server->exec();
173 $this->assertEquals(404, $this->response->getStatus(),
'Error: ' . $this->response->body);
◆ testGetAssetEscapeBasePath()
Sabre\DAV\Browser\PluginTest::testGetAssetEscapeBasePath |
( |
| ) |
|
Definition at line 177 of file PluginTest.php.
References Sabre\DAV\AbstractServer\$request.
179 $request =
new HTTP\Request(
'GET',
'/?sabreAction=asset&assetName=./../assets/favicon.ico');
180 $this->server->httpRequest =
$request;
181 $this->server->exec();
183 $this->assertEquals(404, $this->response->getStatus(),
'Error: ' . $this->response->body);
◆ testGETPassthru()
Sabre\DAV\Browser\PluginTest::testGETPassthru |
( |
| ) |
|
◆ testPostMkCol()
Sabre\DAV\Browser\PluginTest::testPostMkCol |
( |
| ) |
|
Definition at line 123 of file PluginTest.php.
References Sabre\DAV\AbstractServer\$request, Sabre\HTTP\Sapi\createFromServerArray(), and Sabre\DAV\Version\VERSION.
126 'REQUEST_URI' =>
'/',
127 'REQUEST_METHOD' =>
'POST',
128 'CONTENT_TYPE' =>
'application/x-www-form-urlencoded',
131 'sabreAction' =>
'mkcol',
132 'name' =>
'new_collection',
137 $this->server->httpRequest =
$request;
138 $this->server->exec();
140 $this->assertEquals(302, $this->response->status);
141 $this->assertEquals([
144 ], $this->response->getHeaders());
146 $this->assertTrue(is_dir(SABRE_TEMPDIR .
'/new_collection'));
const VERSION
Full version number.
static createFromServerArray(array $serverArray)
This static method will create a new Request object, based on a PHP $_SERVER array.
◆ testPostNoSabreAction()
Sabre\DAV\Browser\PluginTest::testPostNoSabreAction |
( |
| ) |
|
◆ testPostOtherContentType()
Sabre\DAV\Browser\PluginTest::testPostOtherContentType |
( |
| ) |
|
◆ $plugin
Sabre\DAV\Browser\PluginTest::$plugin |
|
protected |
The documentation for this class was generated from the following file: