diff options
Diffstat (limited to 'vendor/sabre/dav/tests/Sabre/DAV/PartialUpdate/SpecificationTest.php')
-rw-r--r-- | vendor/sabre/dav/tests/Sabre/DAV/PartialUpdate/SpecificationTest.php | 40 |
1 files changed, 18 insertions, 22 deletions
diff --git a/vendor/sabre/dav/tests/Sabre/DAV/PartialUpdate/SpecificationTest.php b/vendor/sabre/dav/tests/Sabre/DAV/PartialUpdate/SpecificationTest.php index 2c6274173..56b2d576f 100644 --- a/vendor/sabre/dav/tests/Sabre/DAV/PartialUpdate/SpecificationTest.php +++ b/vendor/sabre/dav/tests/Sabre/DAV/PartialUpdate/SpecificationTest.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Sabre\DAV\PartialUpdate; use Sabre\DAV\FSExt\File; @@ -12,14 +14,14 @@ use Sabre\HTTP; * * See: http://sabre.io/dav/http-patch/ */ -class SpecificationTest extends \PHPUnit_Framework_TestCase { - +class SpecificationTest extends \PHPUnit\Framework\TestCase +{ protected $server; - function setUp() { - + public function setUp() + { $tree = [ - new File(SABRE_TEMPDIR . '/foobar.txt') + new File(SABRE_TEMPDIR.'/foobar.txt'), ]; $server = new Server($tree); $server->debugExceptions = true; @@ -28,32 +30,30 @@ class SpecificationTest extends \PHPUnit_Framework_TestCase { $tree[0]->put('1234567890'); $this->server = $server; - } - function tearDown() { - + public function tearDown() + { \Sabre\TestUtil::clearTempDir(); - } /** * @param string $headerValue * @param string $httpStatus * @param string $endResult - * @param int $contentLength + * @param int $contentLength * * @dataProvider data */ - function testUpdateRange($headerValue, $httpStatus, $endResult, $contentLength = 4) { - + public function testUpdateRange($headerValue, $httpStatus, $endResult, $contentLength = 4) + { $headers = [ - 'Content-Type' => 'application/x-sabredav-partialupdate', + 'Content-Type' => 'application/x-sabredav-partialupdate', 'X-Update-Range' => $headerValue, ]; if ($contentLength) { - $headers['Content-Length'] = (string)$contentLength; + $headers['Content-Length'] = (string) $contentLength; } $request = new HTTP\Request('PATCH', '/foobar.txt', $headers, '----'); @@ -64,15 +64,14 @@ class SpecificationTest extends \PHPUnit_Framework_TestCase { $this->server->sapi = new HTTP\SapiMock(); $this->server->exec(); - $this->assertEquals($httpStatus, $this->server->httpResponse->status, 'Incorrect http status received: ' . $this->server->httpResponse->body); + $this->assertEquals($httpStatus, $this->server->httpResponse->status, 'Incorrect http status received: '.$this->server->httpResponse->body); if (!is_null($endResult)) { - $this->assertEquals($endResult, file_get_contents(SABRE_TEMPDIR . '/foobar.txt')); + $this->assertEquals($endResult, file_get_contents(SABRE_TEMPDIR.'/foobar.txt')); } - } - function data() { - + public function data() + { return [ // Problems ['foo', 400, null], @@ -86,9 +85,6 @@ class SpecificationTest extends \PHPUnit_Framework_TestCase { ['bytes=-2', 204, '12345678----'], ['bytes=2-', 204, '12----7890'], ['append', 204, '1234567890----'], - ]; - } - } |