[Pkg-owncloud-commits] [php-sabredav] 27/34: Test for #659.
David Prévot
taffit at moszumanska.debian.org
Wed May 27 13:57:11 UTC 2015
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to tag 3.0.0-beta1
in repository php-sabredav.
commit 770d310aaa54b949648e3435b0d9a43a3ca29e92
Author: Evert Pot <me at evertpot.com>
Date: Mon May 25 17:13:37 2015 -0400
Test for #659.
---
tests/Sabre/DAV/Browser/PluginTest.php | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/tests/Sabre/DAV/Browser/PluginTest.php b/tests/Sabre/DAV/Browser/PluginTest.php
index 4711e5d..00beea9 100644
--- a/tests/Sabre/DAV/Browser/PluginTest.php
+++ b/tests/Sabre/DAV/Browser/PluginTest.php
@@ -40,6 +40,32 @@ class PluginTest extends DAV\AbstractServer{
$this->assertTrue(strpos($body, '<a href="/dir/child.txt">')!==false);
}
+
+ /**
+ * Adding the If-None-Match should have 0 effect, but it threw an error.
+ */
+ function testCollectionGetIfNoneMatch() {
+
+ $request = new HTTP\Request('GET', '/dir');
+ $request->setHeader('If-None-Match', '"foo-bar"');
+ $this->server->httpRequest = $request;
+ $this->server->exec();
+
+ $this->assertEquals(200, $this->response->getStatus(), "Incorrect status received. Full response body: " . $this->response->getBodyAsString());
+ $this->assertEquals(
+ [
+ 'X-Sabre-Version' => [DAV\Version::VERSION],
+ 'Content-Type' => ['text/html; charset=utf-8'],
+ 'Content-Security-Policy' => ["img-src 'self'; style-src 'self';"]
+ ],
+ $this->response->getHeaders()
+ );
+
+ $body = $this->response->getBodyAsString();
+ $this->assertTrue(strpos($body, '<title>dir') !== false, $body);
+ $this->assertTrue(strpos($body, '<a href="/dir/child.txt">')!==false);
+
+ }
function testCollectionGetRoot() {
$request = new HTTP\Request('GET', '/');
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/php-sabredav.git
More information about the Pkg-owncloud-commits
mailing list