From 66effbfe0827fc61fff6d248797a894213ad20d6 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Sat, 28 May 2016 17:46:24 +0200 Subject: upgrade to sabre32 --- .../tests/Sabre/DAV/TemporaryFileFilterTest.php | 70 +++++++++++----------- 1 file changed, 35 insertions(+), 35 deletions(-) (limited to 'vendor/sabre/dav/tests/Sabre/DAV/TemporaryFileFilterTest.php') diff --git a/vendor/sabre/dav/tests/Sabre/DAV/TemporaryFileFilterTest.php b/vendor/sabre/dav/tests/Sabre/DAV/TemporaryFileFilterTest.php index 7122f4a01..6acd6b077 100644 --- a/vendor/sabre/dav/tests/Sabre/DAV/TemporaryFileFilterTest.php +++ b/vendor/sabre/dav/tests/Sabre/DAV/TemporaryFileFilterTest.php @@ -25,7 +25,7 @@ class TemporaryFileFilterTest extends AbstractServer { $this->assertEquals(201, $this->response->status); $this->assertEquals('0', $this->response->getHeader('Content-Length')); - $this->assertEquals('Testing new file',file_get_contents(SABRE_TEMPDIR . '/testput.txt')); + $this->assertEquals('Testing new file', file_get_contents(SABRE_TEMPDIR . '/testput.txt')); } @@ -39,11 +39,11 @@ class TemporaryFileFilterTest extends AbstractServer { $this->assertEquals('', $this->response->body); $this->assertEquals(201, $this->response->status); - $this->assertEquals(array( + $this->assertEquals([ 'X-Sabre-Temp' => ['true'], - ),$this->response->getHeaders()); + ], $this->response->getHeaders()); - $this->assertFalse(file_exists(SABRE_TEMPDIR . '/._testput.txt'),'._testput.txt should not exist in the regular file structure.'); + $this->assertFalse(file_exists(SABRE_TEMPDIR . '/._testput.txt'), '._testput.txt should not exist in the regular file structure.'); } @@ -57,20 +57,20 @@ class TemporaryFileFilterTest extends AbstractServer { $this->assertEquals('', $this->response->body); $this->assertEquals(201, $this->response->status); - $this->assertEquals(array( + $this->assertEquals([ 'X-Sabre-Temp' => ['true'], - ),$this->response->getHeaders()); + ], $this->response->getHeaders()); - $this->assertFalse(file_exists(SABRE_TEMPDIR . '/._testput.txt'),'._testput.txt should not exist in the regular file structure.'); + $this->assertFalse(file_exists(SABRE_TEMPDIR . '/._testput.txt'), '._testput.txt should not exist in the regular file structure.'); $this->server->exec(); $this->assertEquals(412, $this->response->status); - $this->assertEquals(array( + $this->assertEquals([ 'X-Sabre-Temp' => ['true'], 'Content-Type' => ['application/xml; charset=utf-8'], - ),$this->response->getHeaders()); + ], $this->response->getHeaders()); } @@ -83,9 +83,9 @@ class TemporaryFileFilterTest extends AbstractServer { $this->assertEquals('', $this->response->body); $this->assertEquals(201, $this->response->status); - $this->assertEquals(array( + $this->assertEquals([ 'X-Sabre-Temp' => ['true'], - ),$this->response->getHeaders()); + ], $this->response->getHeaders()); $request = new HTTP\Request('GET', '/._testput.txt'); @@ -93,13 +93,13 @@ class TemporaryFileFilterTest extends AbstractServer { $this->server->exec(); $this->assertEquals(200, $this->response->status); - $this->assertEquals(array( - 'X-Sabre-Temp' => ['true'], + $this->assertEquals([ + 'X-Sabre-Temp' => ['true'], 'Content-Length' => [16], - 'Content-Type' => ['application/octet-stream'], - ),$this->response->getHeaders()); + 'Content-Type' => ['application/octet-stream'], + ], $this->response->getHeaders()); - $this->assertEquals('Testing new file',stream_get_contents($this->response->body)); + $this->assertEquals('Testing new file', stream_get_contents($this->response->body)); } @@ -125,11 +125,11 @@ class TemporaryFileFilterTest extends AbstractServer { $this->server->exec(); $this->assertEquals(201, $this->response->status); - $this->assertEquals('application/xml; charset=utf-8',$this->response->getHeader('Content-Type')); - $this->assertTrue(preg_match('/^$/',$this->response->getHeader('Lock-Token'))===1,'We did not get a valid Locktoken back (' . $this->response->getHeader('Lock-Token') . ')'); - $this->assertEquals('true',$this->response->getHeader('X-Sabre-Temp')); + $this->assertEquals('application/xml; charset=utf-8', $this->response->getHeader('Content-Type')); + $this->assertTrue(preg_match('/^$/', $this->response->getHeader('Lock-Token')) === 1, 'We did not get a valid Locktoken back (' . $this->response->getHeader('Lock-Token') . ')'); + $this->assertEquals('true', $this->response->getHeader('X-Sabre-Temp')); - $this->assertFalse(file_exists(SABRE_TEMPDIR . '/._testlock.txt'),'._testlock.txt should not exist in the regular file structure.'); + $this->assertFalse(file_exists(SABRE_TEMPDIR . '/._testlock.txt'), '._testlock.txt should not exist in the regular file structure.'); } @@ -143,20 +143,20 @@ class TemporaryFileFilterTest extends AbstractServer { $this->assertEquals('', $this->response->body); $this->assertEquals(201, $this->response->status); - $this->assertEquals(array( + $this->assertEquals([ 'X-Sabre-Temp' => ['true'], - ),$this->response->getHeaders()); + ], $this->response->getHeaders()); $request = new HTTP\Request('DELETE', '/._testput.txt'); $this->server->httpRequest = $request; $this->server->exec(); - $this->assertEquals(204, $this->response->status, "Incorrect status code received. Full body:\n". $this->response->body); - $this->assertEquals(array( + $this->assertEquals(204, $this->response->status, "Incorrect status code received. Full body:\n" . $this->response->body); + $this->assertEquals([ 'X-Sabre-Temp' => ['true'], - ),$this->response->getHeaders()); + ], $this->response->getHeaders()); - $this->assertEquals('',$this->response->body); + $this->assertEquals('', $this->response->body); } @@ -169,30 +169,30 @@ class TemporaryFileFilterTest extends AbstractServer { $this->assertEquals('', $this->response->body); $this->assertEquals(201, $this->response->status); - $this->assertEquals(array( + $this->assertEquals([ 'X-Sabre-Temp' => ['true'], - ),$this->response->getHeaders()); + ], $this->response->getHeaders()); $request = new HTTP\Request('PROPFIND', '/._testput.txt'); $this->server->httpRequest = ($request); $this->server->exec(); - $this->assertEquals(207, $this->response->status,'Incorrect status code returned. Body: ' . $this->response->body); - $this->assertEquals(array( + $this->assertEquals(207, $this->response->status, 'Incorrect status code returned. Body: ' . $this->response->body); + $this->assertEquals([ 'X-Sabre-Temp' => ['true'], 'Content-Type' => ['application/xml; charset=utf-8'], - ),$this->response->getHeaders()); + ], $this->response->getHeaders()); - $body = preg_replace("/xmlns(:[A-Za-z0-9_])?=(\"|\')DAV:(\"|\')/","xmlns\\1=\"urn:DAV\"",$this->response->body); + $body = preg_replace("/xmlns(:[A-Za-z0-9_])?=(\"|\')DAV:(\"|\')/", "xmlns\\1=\"urn:DAV\"", $this->response->body); $xml = simplexml_load_string($body); - $xml->registerXPathNamespace('d','urn:DAV'); + $xml->registerXPathNamespace('d', 'urn:DAV'); list($data) = $xml->xpath('/d:multistatus/d:response/d:href'); - $this->assertEquals('/._testput.txt',(string)$data,'href element should have been /._testput.txt'); + $this->assertEquals('/._testput.txt', (string)$data, 'href element should have been /._testput.txt'); $data = $xml->xpath('/d:multistatus/d:response/d:propstat/d:prop/d:resourcetype'); - $this->assertEquals(1,count($data)); + $this->assertEquals(1, count($data)); } -- cgit v1.2.3