diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2015-11-20 13:35:23 +0100 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2015-11-24 15:11:54 +0100 |
commit | ae36c01b959d1cbdaeabb46d30cb416aae428a88 (patch) | |
tree | 8a7e577b3565d20ab1a14896e6cf0bd05054e119 /apps/dav/tests/unit/connector/sabre/FakeLockerPluginTest.php | |
parent | eacb24c1518ca80871447fbb500f093a0c280ee6 (diff) | |
download | nextcloud-server-ae36c01b959d1cbdaeabb46d30cb416aae428a88.tar.gz nextcloud-server-ae36c01b959d1cbdaeabb46d30cb416aae428a88.zip |
Adjust sabre changes in core
Diffstat (limited to 'apps/dav/tests/unit/connector/sabre/FakeLockerPluginTest.php')
-rw-r--r-- | apps/dav/tests/unit/connector/sabre/FakeLockerPluginTest.php | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/apps/dav/tests/unit/connector/sabre/FakeLockerPluginTest.php b/apps/dav/tests/unit/connector/sabre/FakeLockerPluginTest.php index dfe8cc220a3..8539e9c06ee 100644 --- a/apps/dav/tests/unit/connector/sabre/FakeLockerPluginTest.php +++ b/apps/dav/tests/unit/connector/sabre/FakeLockerPluginTest.php @@ -21,6 +21,7 @@ namespace OCA\DAV\Tests\Unit\Connector\Sabre; use OCA\DAV\Connector\Sabre\FakeLockerPlugin; +use Sabre\HTTP\Response; use Test\TestCase; /** @@ -141,20 +142,19 @@ class FakeLockerPluginTest extends TestCase { public function testFakeLockProvider() { $request = $this->getMock('\Sabre\HTTP\RequestInterface'); - $response = $this->getMock('\Sabre\HTTP\ResponseInterface'); + $response = new Response(); $server = $this->getMock('\Sabre\DAV\Server'); $this->fakeLockerPlugin->initialize($server); $request->expects($this->exactly(2)) ->method('getPath') ->will($this->returnValue('MyPath')); - $response->expects($this->once()) - ->method('setBody') - ->with('<?xml version="1.0" encoding="utf-8"?> -<d:prop xmlns:d="DAV:"><d:lockdiscovery><d:activelock><d:lockscope><d:exclusive/></d:lockscope><d:locktype><d:write/></d:locktype><d:lockroot><d:href>MyPath</d:href></d:lockroot><d:depth>infinity</d:depth><d:timeout>Second-1800</d:timeout><d:locktoken><d:href>opaquelocktoken:fe4f7f2437b151fbcb4e9f5c8118c6b1</d:href></d:locktoken><d:owner/></d:activelock></d:lockdiscovery></d:prop> -'); $this->assertSame(false, $this->fakeLockerPlugin->fakeLockProvider($request, $response)); + + $expectedXml = '<?xml version="1.0" encoding="utf-8"?><d:prop xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns"><d:lockdiscovery><d:activelock><d:lockscope><d:exclusive/></d:lockscope><d:locktype><d:write/></d:locktype><d:lockroot><d:href>MyPath</d:href></d:lockroot><d:depth>infinity</d:depth><d:timeout>Second-1800</d:timeout><d:locktoken><d:href>opaquelocktoken:fe4f7f2437b151fbcb4e9f5c8118c6b1</d:href></d:locktoken><d:owner/></d:activelock></d:lockdiscovery></d:prop>'; + + $this->assertXmlStringEqualsXmlString($expectedXml, $response->getBody()); } public function testFakeUnlockProvider() { |