aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/sabre/dav/tests/Sabre/DAV
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2020-05-07 15:22:25 +0000
committerMario <mario@mariovavti.com>2020-05-07 15:22:25 +0000
commitdbfe748d274f6843fc91a3071df7be45c4ab5b00 (patch)
tree3b59194620f319b16a88dcc2aa5bacbea1c3d188 /vendor/sabre/dav/tests/Sabre/DAV
parent4ee809bed6ea023ad9e2888eedd65e083d4c1e3e (diff)
downloadvolse-hubzilla-dbfe748d274f6843fc91a3071df7be45c4ab5b00.tar.gz
volse-hubzilla-dbfe748d274f6843fc91a3071df7be45c4ab5b00.tar.bz2
volse-hubzilla-dbfe748d274f6843fc91a3071df7be45c4ab5b00.zip
composer updates
Diffstat (limited to 'vendor/sabre/dav/tests/Sabre/DAV')
-rw-r--r--vendor/sabre/dav/tests/Sabre/DAV/AbstractServer.php4
-rw-r--r--vendor/sabre/dav/tests/Sabre/DAV/Auth/Backend/AbstractDigestTest.php4
-rw-r--r--vendor/sabre/dav/tests/Sabre/DAV/Auth/Backend/AbstractPDOTest.php2
-rw-r--r--vendor/sabre/dav/tests/Sabre/DAV/Auth/Backend/FileTest.php6
-rw-r--r--vendor/sabre/dav/tests/Sabre/DAV/Auth/Backend/Mock.php6
-rw-r--r--vendor/sabre/dav/tests/Sabre/DAV/Auth/PluginTest.php8
-rw-r--r--vendor/sabre/dav/tests/Sabre/DAV/BasicNodeTest.php28
-rw-r--r--vendor/sabre/dav/tests/Sabre/DAV/Browser/GuessContentTypeTest.php5
-rw-r--r--vendor/sabre/dav/tests/Sabre/DAV/Browser/MapGetToPropFindTest.php4
-rw-r--r--vendor/sabre/dav/tests/Sabre/DAV/Browser/PluginTest.php4
-rw-r--r--vendor/sabre/dav/tests/Sabre/DAV/ClientTest.php16
-rw-r--r--vendor/sabre/dav/tests/Sabre/DAV/FSExt/FileTest.php6
-rw-r--r--vendor/sabre/dav/tests/Sabre/DAV/FSExt/ServerTest.php2
-rw-r--r--vendor/sabre/dav/tests/Sabre/DAV/Issue33Test.php4
-rw-r--r--vendor/sabre/dav/tests/Sabre/DAV/Locks/Backend/FileTest.php4
-rw-r--r--vendor/sabre/dav/tests/Sabre/DAV/Locks/MSWordTest.php5
-rw-r--r--vendor/sabre/dav/tests/Sabre/DAV/Locks/PluginTest.php8
-rw-r--r--vendor/sabre/dav/tests/Sabre/DAV/Mock/Collection.php8
-rw-r--r--vendor/sabre/dav/tests/Sabre/DAV/Mount/PluginTest.php4
-rw-r--r--vendor/sabre/dav/tests/Sabre/DAV/ObjectTreeTest.php6
-rw-r--r--vendor/sabre/dav/tests/Sabre/DAV/PartialUpdate/PluginTest.php4
-rw-r--r--vendor/sabre/dav/tests/Sabre/DAV/PartialUpdate/SpecificationTest.php4
-rw-r--r--vendor/sabre/dav/tests/Sabre/DAV/ServerEventsTest.php2
-rw-r--r--vendor/sabre/dav/tests/Sabre/DAV/ServerPluginTest.php5
-rw-r--r--vendor/sabre/dav/tests/Sabre/DAV/ServerPreconditionTest.php283
-rw-r--r--vendor/sabre/dav/tests/Sabre/DAV/ServerPropsTest.php7
-rw-r--r--vendor/sabre/dav/tests/Sabre/DAV/ServerRangeTest.php4
-rw-r--r--vendor/sabre/dav/tests/Sabre/DAV/ServerSimpleTest.php10
-rw-r--r--vendor/sabre/dav/tests/Sabre/DAV/StringUtilTest.php8
-rw-r--r--vendor/sabre/dav/tests/Sabre/DAV/TemporaryFileFilterTest.php2
-rw-r--r--vendor/sabre/dav/tests/Sabre/DAV/TreeTest.php4
31 files changed, 54 insertions, 413 deletions
diff --git a/vendor/sabre/dav/tests/Sabre/DAV/AbstractServer.php b/vendor/sabre/dav/tests/Sabre/DAV/AbstractServer.php
index bf1e22aea..807b66382 100644
--- a/vendor/sabre/dav/tests/Sabre/DAV/AbstractServer.php
+++ b/vendor/sabre/dav/tests/Sabre/DAV/AbstractServer.php
@@ -19,7 +19,7 @@ abstract class AbstractServer extends \PHPUnit\Framework\TestCase
protected $server;
protected $tempDir = SABRE_TEMPDIR;
- public function setUp()
+ public function setup(): void
{
$this->response = new HTTP\ResponseMock();
$this->server = new Server($this->getRootNode());
@@ -32,7 +32,7 @@ abstract class AbstractServer extends \PHPUnit\Framework\TestCase
file_put_contents(SABRE_TEMPDIR.'/dir/child.txt', 'Child contents');
}
- public function tearDown()
+ public function teardown(): void
{
$this->deleteTree(SABRE_TEMPDIR, false);
}
diff --git a/vendor/sabre/dav/tests/Sabre/DAV/Auth/Backend/AbstractDigestTest.php b/vendor/sabre/dav/tests/Sabre/DAV/Auth/Backend/AbstractDigestTest.php
index d9af326fe..a751efdc2 100644
--- a/vendor/sabre/dav/tests/Sabre/DAV/Auth/Backend/AbstractDigestTest.php
+++ b/vendor/sabre/dav/tests/Sabre/DAV/Auth/Backend/AbstractDigestTest.php
@@ -35,11 +35,9 @@ class AbstractDigestTest extends \PHPUnit\Framework\TestCase
);
}
- /**
- * @expectedException \Sabre\DAV\Exception
- */
public function testCheckBadGetUserInfoResponse2()
{
+ $this->expectException('Sabre\DAV\Exception');
$header = 'username=array, realm=myRealm, nonce=12345, uri=/, response=HASH, opaque=1, qop=auth, nc=1, cnonce=1';
$request = HTTP\Sapi::createFromServerArray([
'REQUEST_METHOD' => 'GET',
diff --git a/vendor/sabre/dav/tests/Sabre/DAV/Auth/Backend/AbstractPDOTest.php b/vendor/sabre/dav/tests/Sabre/DAV/Auth/Backend/AbstractPDOTest.php
index 5e34f9c49..8b874f884 100644
--- a/vendor/sabre/dav/tests/Sabre/DAV/Auth/Backend/AbstractPDOTest.php
+++ b/vendor/sabre/dav/tests/Sabre/DAV/Auth/Backend/AbstractPDOTest.php
@@ -8,7 +8,7 @@ abstract class AbstractPDOTest extends \PHPUnit\Framework\TestCase
{
use \Sabre\DAV\DbTestHelperTrait;
- public function setUp()
+ public function setup(): void
{
$this->dropTables('users');
$this->createSchema('users');
diff --git a/vendor/sabre/dav/tests/Sabre/DAV/Auth/Backend/FileTest.php b/vendor/sabre/dav/tests/Sabre/DAV/Auth/Backend/FileTest.php
index 0297b17f9..31a86f9ed 100644
--- a/vendor/sabre/dav/tests/Sabre/DAV/Auth/Backend/FileTest.php
+++ b/vendor/sabre/dav/tests/Sabre/DAV/Auth/Backend/FileTest.php
@@ -6,7 +6,7 @@ namespace Sabre\DAV\Auth\Backend;
class FileTest extends \PHPUnit\Framework\TestCase
{
- public function tearDown()
+ public function teardown(): void
{
if (file_exists(SABRE_TEMPDIR.'/filebackend')) {
unlink(SABRE_TEMPDIR.'/filebackend');
@@ -19,11 +19,9 @@ class FileTest extends \PHPUnit\Framework\TestCase
$this->assertTrue($file instanceof File);
}
- /**
- * @expectedException \Sabre\DAV\Exception
- */
public function testLoadFileBroken()
{
+ $this->expectException('Sabre\DAV\Exception');
file_put_contents(SABRE_TEMPDIR.'/backend', 'user:realm:hash');
$file = new File(SABRE_TEMPDIR.'/backend');
}
diff --git a/vendor/sabre/dav/tests/Sabre/DAV/Auth/Backend/Mock.php b/vendor/sabre/dav/tests/Sabre/DAV/Auth/Backend/Mock.php
index 730f2a975..fca7f722f 100644
--- a/vendor/sabre/dav/tests/Sabre/DAV/Auth/Backend/Mock.php
+++ b/vendor/sabre/dav/tests/Sabre/DAV/Auth/Backend/Mock.php
@@ -44,9 +44,6 @@ class Mock implements BackendInterface
*
* principals/users/[username]
*
- * @param RequestInterface $request
- * @param ResponseInterface $response
- *
* @return array
*/
public function check(RequestInterface $request, ResponseInterface $response)
@@ -77,9 +74,6 @@ class Mock implements BackendInterface
* WWW-Authenticate headers may already have been set, and you'll want to
* append your own WWW-Authenticate header instead of overwriting the
* existing one.
- *
- * @param RequestInterface $request
- * @param ResponseInterface $response
*/
public function challenge(RequestInterface $request, ResponseInterface $response)
{
diff --git a/vendor/sabre/dav/tests/Sabre/DAV/Auth/PluginTest.php b/vendor/sabre/dav/tests/Sabre/DAV/Auth/PluginTest.php
index 03c8a4624..f4810d524 100644
--- a/vendor/sabre/dav/tests/Sabre/DAV/Auth/PluginTest.php
+++ b/vendor/sabre/dav/tests/Sabre/DAV/Auth/PluginTest.php
@@ -16,7 +16,7 @@ class PluginTest extends \PHPUnit\Framework\TestCase
$this->assertTrue($plugin instanceof Plugin);
$fakeServer->addPlugin($plugin);
$this->assertEquals($plugin, $fakeServer->getPlugin('auth'));
- $this->assertInternalType('array', $plugin->getPluginInfo());
+ $this->assertIsArray($plugin->getPluginInfo());
}
/**
@@ -34,10 +34,10 @@ class PluginTest extends \PHPUnit\Framework\TestCase
/**
* @depends testInit
- * @expectedException \Sabre\DAV\Exception\NotAuthenticated
*/
public function testAuthenticateFail()
{
+ $this->expectException('Sabre\DAV\Exception\NotAuthenticated');
$fakeServer = new DAV\Server(new DAV\SimpleCollection('bla'));
$backend = new Backend\Mock();
$backend->fail = true;
@@ -87,10 +87,10 @@ class PluginTest extends \PHPUnit\Framework\TestCase
/**
* @depends testInit
- * @expectedException \Sabre\DAV\Exception
*/
public function testNoAuthBackend()
{
+ $this->expectException('Sabre\DAV\Exception');
$fakeServer = new DAV\Server(new DAV\SimpleCollection('bla'));
$plugin = new Plugin();
@@ -100,10 +100,10 @@ class PluginTest extends \PHPUnit\Framework\TestCase
/**
* @depends testInit
- * @expectedException \Sabre\DAV\Exception
*/
public function testInvalidCheckResponse()
{
+ $this->expectException('Sabre\DAV\Exception');
$fakeServer = new DAV\Server(new DAV\SimpleCollection('bla'));
$backend = new Backend\Mock();
$backend->invalidCheckResponse = true;
diff --git a/vendor/sabre/dav/tests/Sabre/DAV/BasicNodeTest.php b/vendor/sabre/dav/tests/Sabre/DAV/BasicNodeTest.php
index 60fcc73fc..e9a8eddad 100644
--- a/vendor/sabre/dav/tests/Sabre/DAV/BasicNodeTest.php
+++ b/vendor/sabre/dav/tests/Sabre/DAV/BasicNodeTest.php
@@ -6,20 +6,16 @@ namespace Sabre\DAV;
class BasicNodeTest extends \PHPUnit\Framework\TestCase
{
- /**
- * @expectedException \Sabre\DAV\Exception\Forbidden
- */
public function testPut()
{
+ $this->expectException('Sabre\DAV\Exception\Forbidden');
$file = new FileMock();
$file->put('hi');
}
- /**
- * @expectedException \Sabre\DAV\Exception\Forbidden
- */
public function testGet()
{
+ $this->expectException('Sabre\DAV\Exception\Forbidden');
$file = new FileMock();
$file->get();
}
@@ -42,20 +38,16 @@ class BasicNodeTest extends \PHPUnit\Framework\TestCase
$this->assertNull($file->getContentType());
}
- /**
- * @expectedException \Sabre\DAV\Exception\Forbidden
- */
public function testDelete()
{
+ $this->expectException('Sabre\DAV\Exception\Forbidden');
$file = new FileMock();
$file->delete();
}
- /**
- * @expectedException \Sabre\DAV\Exception\Forbidden
- */
public function testSetName()
{
+ $this->expectException('Sabre\DAV\Exception\Forbidden');
$file = new FileMock();
$file->setName('hi');
}
@@ -88,29 +80,23 @@ class BasicNodeTest extends \PHPUnit\Framework\TestCase
$this->assertFalse($dir->childExists('mockfile2'));
}
- /**
- * @expectedException \Sabre\DAV\Exception\NotFound
- */
public function testGetChild404()
{
+ $this->expectException('Sabre\DAV\Exception\NotFound');
$dir = new DirectoryMock();
$file = $dir->getChild('blabla');
}
- /**
- * @expectedException \Sabre\DAV\Exception\Forbidden
- */
public function testCreateFile()
{
+ $this->expectException('Sabre\DAV\Exception\Forbidden');
$dir = new DirectoryMock();
$dir->createFile('hello', 'data');
}
- /**
- * @expectedException \Sabre\DAV\Exception\Forbidden
- */
public function testCreateDirectory()
{
+ $this->expectException('Sabre\DAV\Exception\Forbidden');
$dir = new DirectoryMock();
$dir->createDirectory('hello');
}
diff --git a/vendor/sabre/dav/tests/Sabre/DAV/Browser/GuessContentTypeTest.php b/vendor/sabre/dav/tests/Sabre/DAV/Browser/GuessContentTypeTest.php
index 1f48256e0..cb4d3ce03 100644
--- a/vendor/sabre/dav/tests/Sabre/DAV/Browser/GuessContentTypeTest.php
+++ b/vendor/sabre/dav/tests/Sabre/DAV/Browser/GuessContentTypeTest.php
@@ -6,10 +6,9 @@ namespace Sabre\DAV\Browser;
use Sabre\DAV;
-require_once 'Sabre/DAV/AbstractServer.php';
class GuessContentTypeTest extends DAV\AbstractServer
{
- public function setUp()
+ public function setUp(): void
{
parent::setUp();
\Sabre\TestUtil::clearTempDir();
@@ -17,7 +16,7 @@ class GuessContentTypeTest extends DAV\AbstractServer
file_put_contents(SABRE_TEMPDIR.'/somefile.hoi', 'blabla');
}
- public function tearDown()
+ public function tearDown(): void
{
\Sabre\TestUtil::clearTempDir();
parent::tearDown();
diff --git a/vendor/sabre/dav/tests/Sabre/DAV/Browser/MapGetToPropFindTest.php b/vendor/sabre/dav/tests/Sabre/DAV/Browser/MapGetToPropFindTest.php
index f51f5546c..00b2661ac 100644
--- a/vendor/sabre/dav/tests/Sabre/DAV/Browser/MapGetToPropFindTest.php
+++ b/vendor/sabre/dav/tests/Sabre/DAV/Browser/MapGetToPropFindTest.php
@@ -7,11 +7,9 @@ namespace Sabre\DAV\Browser;
use Sabre\DAV;
use Sabre\HTTP;
-require_once 'Sabre/DAV/AbstractServer.php';
-
class MapGetToPropFindTest extends DAV\AbstractServer
{
- public function setUp()
+ public function setUp(): void
{
parent::setUp();
$this->server->addPlugin(new MapGetToPropFind());
diff --git a/vendor/sabre/dav/tests/Sabre/DAV/Browser/PluginTest.php b/vendor/sabre/dav/tests/Sabre/DAV/Browser/PluginTest.php
index f28661ca7..a987525c0 100644
--- a/vendor/sabre/dav/tests/Sabre/DAV/Browser/PluginTest.php
+++ b/vendor/sabre/dav/tests/Sabre/DAV/Browser/PluginTest.php
@@ -7,13 +7,11 @@ namespace Sabre\DAV\Browser;
use Sabre\DAV;
use Sabre\HTTP;
-require_once 'Sabre/DAV/AbstractServer.php';
-
class PluginTest extends DAV\AbstractServer
{
protected $plugin;
- public function setUp()
+ public function setUp(): void
{
parent::setUp();
$this->server->addPlugin($this->plugin = new Plugin());
diff --git a/vendor/sabre/dav/tests/Sabre/DAV/ClientTest.php b/vendor/sabre/dav/tests/Sabre/DAV/ClientTest.php
index e9362c8e4..85a95c90e 100644
--- a/vendor/sabre/dav/tests/Sabre/DAV/ClientTest.php
+++ b/vendor/sabre/dav/tests/Sabre/DAV/ClientTest.php
@@ -6,11 +6,9 @@ namespace Sabre\DAV;
use Sabre\HTTP\Response;
-require_once 'Sabre/DAV/ClientMock.php';
-
class ClientTest extends \PHPUnit\Framework\TestCase
{
- public function setUp()
+ public function setup(): void
{
if (!function_exists('curl_init')) {
$this->markTestSkipped('CURL must be installed to test the client');
@@ -25,11 +23,9 @@ class ClientTest extends \PHPUnit\Framework\TestCase
$this->assertInstanceOf('Sabre\DAV\ClientMock', $client);
}
- /**
- * @expectedException \InvalidArgumentException
- */
public function testConstructNoBaseUri()
{
+ $this->expectException('InvalidArgumentException');
$client = new ClientMock([]);
}
@@ -139,11 +135,9 @@ XML;
], $request->getHeaders());
}
- /**
- * @expectedException \Sabre\HTTP\ClientHttpException
- */
public function testPropFindError()
{
+ $this->expectException('Sabre\HTTP\ClientHttpException');
$client = new ClientMock([
'baseUri' => '/',
]);
@@ -225,10 +219,10 @@ XML;
/**
* @depends testPropPatch
- * @expectedException \Sabre\HTTP\ClientHttpException
*/
public function testPropPatchHTTPError()
{
+ $this->expectException('Sabre\HTTP\ClientHttpException');
$client = new ClientMock([
'baseUri' => '/',
]);
@@ -239,10 +233,10 @@ XML;
/**
* @depends testPropPatch
- * @expectedException \Sabre\HTTP\ClientException
*/
public function testPropPatchMultiStatusError()
{
+ $this->expectException('Sabre\HTTP\ClientException');
$client = new ClientMock([
'baseUri' => '/',
]);
diff --git a/vendor/sabre/dav/tests/Sabre/DAV/FSExt/FileTest.php b/vendor/sabre/dav/tests/Sabre/DAV/FSExt/FileTest.php
index 4bc79b597..2b759e5d0 100644
--- a/vendor/sabre/dav/tests/Sabre/DAV/FSExt/FileTest.php
+++ b/vendor/sabre/dav/tests/Sabre/DAV/FSExt/FileTest.php
@@ -4,16 +4,14 @@ declare(strict_types=1);
namespace Sabre\DAV\FSExt;
-require_once 'Sabre/TestUtil.php';
-
class FileTest extends \PHPUnit\Framework\TestCase
{
- public function setUp()
+ public function setup(): void
{
file_put_contents(SABRE_TEMPDIR.'/file.txt', 'Contents');
}
- public function tearDown()
+ public function teardown(): void
{
\Sabre\TestUtil::clearTempDir();
}
diff --git a/vendor/sabre/dav/tests/Sabre/DAV/FSExt/ServerTest.php b/vendor/sabre/dav/tests/Sabre/DAV/FSExt/ServerTest.php
index f53807e6c..79ffb0186 100644
--- a/vendor/sabre/dav/tests/Sabre/DAV/FSExt/ServerTest.php
+++ b/vendor/sabre/dav/tests/Sabre/DAV/FSExt/ServerTest.php
@@ -7,8 +7,6 @@ namespace Sabre\DAV\FSExt;
use Sabre\DAV;
use Sabre\HTTP;
-require_once 'Sabre/DAV/AbstractServer.php';
-
class ServerTest extends DAV\AbstractServer
{
protected function getRootNode()
diff --git a/vendor/sabre/dav/tests/Sabre/DAV/Issue33Test.php b/vendor/sabre/dav/tests/Sabre/DAV/Issue33Test.php
index 500ad6147..36b182c44 100644
--- a/vendor/sabre/dav/tests/Sabre/DAV/Issue33Test.php
+++ b/vendor/sabre/dav/tests/Sabre/DAV/Issue33Test.php
@@ -6,11 +6,9 @@ namespace Sabre\DAV;
use Sabre\HTTP;
-require_once 'Sabre/TestUtil.php';
-
class Issue33Test extends \PHPUnit\Framework\TestCase
{
- public function setUp()
+ public function setup(): void
{
\Sabre\TestUtil::clearTempDir();
}
diff --git a/vendor/sabre/dav/tests/Sabre/DAV/Locks/Backend/FileTest.php b/vendor/sabre/dav/tests/Sabre/DAV/Locks/Backend/FileTest.php
index 50f17a7dd..57a3255c7 100644
--- a/vendor/sabre/dav/tests/Sabre/DAV/Locks/Backend/FileTest.php
+++ b/vendor/sabre/dav/tests/Sabre/DAV/Locks/Backend/FileTest.php
@@ -4,8 +4,6 @@ declare(strict_types=1);
namespace Sabre\DAV\Locks\Backend;
-require_once 'Sabre/TestUtil.php';
-
class FileTest extends AbstractTest
{
public function getBackend()
@@ -16,7 +14,7 @@ class FileTest extends AbstractTest
return $backend;
}
- public function tearDown()
+ public function teardown(): void
{
\Sabre\TestUtil::clearTempDir();
}
diff --git a/vendor/sabre/dav/tests/Sabre/DAV/Locks/MSWordTest.php b/vendor/sabre/dav/tests/Sabre/DAV/Locks/MSWordTest.php
index a2a31e87f..02c3d39ba 100644
--- a/vendor/sabre/dav/tests/Sabre/DAV/Locks/MSWordTest.php
+++ b/vendor/sabre/dav/tests/Sabre/DAV/Locks/MSWordTest.php
@@ -7,12 +7,9 @@ namespace Sabre\DAV\Locks;
use Sabre\DAV;
use Sabre\HTTP;
-require_once 'Sabre/HTTP/ResponseMock.php';
-require_once 'Sabre/TestUtil.php';
-
class MSWordTest extends \PHPUnit\Framework\TestCase
{
- public function tearDown()
+ public function teardown(): void
{
\Sabre\TestUtil::clearTempDir();
}
diff --git a/vendor/sabre/dav/tests/Sabre/DAV/Locks/PluginTest.php b/vendor/sabre/dav/tests/Sabre/DAV/Locks/PluginTest.php
index a9c6cc1bc..96e3939d0 100644
--- a/vendor/sabre/dav/tests/Sabre/DAV/Locks/PluginTest.php
+++ b/vendor/sabre/dav/tests/Sabre/DAV/Locks/PluginTest.php
@@ -7,8 +7,6 @@ namespace Sabre\DAV\Locks;
use Sabre\DAV;
use Sabre\HTTP;
-require_once 'Sabre/DAV/AbstractServer.php';
-
class PluginTest extends DAV\AbstractServer
{
/**
@@ -16,7 +14,7 @@ class PluginTest extends DAV\AbstractServer
*/
protected $locksPlugin;
- public function setUp()
+ public function setup(): void
{
parent::setUp();
$locksBackend = new Backend\File(SABRE_TEMPDIR.'/locksdb');
@@ -851,11 +849,9 @@ class PluginTest extends DAV\AbstractServer
$this->assertEquals(LockInfo::TIMEOUT_INFINITE, $this->locksPlugin->getTimeoutHeader());
}
- /**
- * @expectedException \Sabre\DAV\Exception\BadRequest
- */
public function testGetTimeoutHeaderInvalid()
{
+ $this->expectException('Sabre\DAV\Exception\BadRequest');
$request = new HTTP\Request('GET', '/', ['Timeout' => 'yourmom']);
$this->server->httpRequest = $request;
diff --git a/vendor/sabre/dav/tests/Sabre/DAV/Mock/Collection.php b/vendor/sabre/dav/tests/Sabre/DAV/Mock/Collection.php
index e0bdecc09..041274706 100644
--- a/vendor/sabre/dav/tests/Sabre/DAV/Mock/Collection.php
+++ b/vendor/sabre/dav/tests/Sabre/DAV/Mock/Collection.php
@@ -31,7 +31,6 @@ class Collection extends DAV\Collection
* Creates the object.
*
* @param string $name
- * @param array $children
* @param Collection $parent
*/
public function __construct($name, array $children = [], Collection $parent = null)
@@ -88,8 +87,11 @@ class Collection extends DAV\Collection
*
* @return string|null
*/
- public function createFile($name, $data = '')
+ public function createFile($name, $data = null)
{
+ if (null === $data) {
+ $data = '';
+ }
if (is_resource($data)) {
$data = stream_get_contents($data);
}
@@ -120,8 +122,6 @@ class Collection extends DAV\Collection
/**
* Adds an already existing node to this collection.
- *
- * @param \Sabre\DAV\INode $node
*/
public function addNode(\Sabre\DAV\INode $node)
{
diff --git a/vendor/sabre/dav/tests/Sabre/DAV/Mount/PluginTest.php b/vendor/sabre/dav/tests/Sabre/DAV/Mount/PluginTest.php
index 0e3123b35..54f7e4cb4 100644
--- a/vendor/sabre/dav/tests/Sabre/DAV/Mount/PluginTest.php
+++ b/vendor/sabre/dav/tests/Sabre/DAV/Mount/PluginTest.php
@@ -7,11 +7,9 @@ namespace Sabre\DAV\Mount;
use Sabre\DAV;
use Sabre\HTTP;
-require_once 'Sabre/DAV/AbstractServer.php';
-
class PluginTest extends DAV\AbstractServer
{
- public function setUp()
+ public function setup(): void
{
parent::setUp();
$this->server->addPlugin(new Plugin());
diff --git a/vendor/sabre/dav/tests/Sabre/DAV/ObjectTreeTest.php b/vendor/sabre/dav/tests/Sabre/DAV/ObjectTreeTest.php
index 6b6652967..7066c49fc 100644
--- a/vendor/sabre/dav/tests/Sabre/DAV/ObjectTreeTest.php
+++ b/vendor/sabre/dav/tests/Sabre/DAV/ObjectTreeTest.php
@@ -4,13 +4,11 @@ declare(strict_types=1);
namespace Sabre\DAV;
-require_once 'Sabre/TestUtil.php';
-
class ObjectTreeTest extends \PHPUnit\Framework\TestCase
{
protected $tree;
- public function setup()
+ public function setup(): void
{
\Sabre\TestUtil::clearTempDir();
mkdir(SABRE_TEMPDIR.'/root');
@@ -21,7 +19,7 @@ class ObjectTreeTest extends \PHPUnit\Framework\TestCase
$this->tree = new Tree($rootNode);
}
- public function teardown()
+ public function teardown(): void
{
\Sabre\TestUtil::clearTempDir();
}
diff --git a/vendor/sabre/dav/tests/Sabre/DAV/PartialUpdate/PluginTest.php b/vendor/sabre/dav/tests/Sabre/DAV/PartialUpdate/PluginTest.php
index 0cf6dc4e4..4d99aee7d 100644
--- a/vendor/sabre/dav/tests/Sabre/DAV/PartialUpdate/PluginTest.php
+++ b/vendor/sabre/dav/tests/Sabre/DAV/PartialUpdate/PluginTest.php
@@ -6,14 +6,12 @@ namespace Sabre\DAV\PartialUpdate;
use Sabre\HTTP;
-require_once 'Sabre/DAV/PartialUpdate/FileMock.php';
-
class PluginTest extends \Sabre\DAVServerTest
{
protected $node;
protected $plugin;
- public function setUp()
+ public function setup(): void
{
$this->node = new FileMock();
$this->tree[] = $this->node;
diff --git a/vendor/sabre/dav/tests/Sabre/DAV/PartialUpdate/SpecificationTest.php b/vendor/sabre/dav/tests/Sabre/DAV/PartialUpdate/SpecificationTest.php
index 56b2d576f..a727a13e2 100644
--- a/vendor/sabre/dav/tests/Sabre/DAV/PartialUpdate/SpecificationTest.php
+++ b/vendor/sabre/dav/tests/Sabre/DAV/PartialUpdate/SpecificationTest.php
@@ -18,7 +18,7 @@ class SpecificationTest extends \PHPUnit\Framework\TestCase
{
protected $server;
- public function setUp()
+ public function setup(): void
{
$tree = [
new File(SABRE_TEMPDIR.'/foobar.txt'),
@@ -32,7 +32,7 @@ class SpecificationTest extends \PHPUnit\Framework\TestCase
$this->server = $server;
}
- public function tearDown()
+ public function teardown(): void
{
\Sabre\TestUtil::clearTempDir();
}
diff --git a/vendor/sabre/dav/tests/Sabre/DAV/ServerEventsTest.php b/vendor/sabre/dav/tests/Sabre/DAV/ServerEventsTest.php
index 7d55ea02e..b1f6754ea 100644
--- a/vendor/sabre/dav/tests/Sabre/DAV/ServerEventsTest.php
+++ b/vendor/sabre/dav/tests/Sabre/DAV/ServerEventsTest.php
@@ -6,8 +6,6 @@ namespace Sabre\DAV;
use Sabre\HTTP;
-require_once 'Sabre/DAV/AbstractServer.php';
-
class ServerEventsTest extends AbstractServer
{
private $tempPath;
diff --git a/vendor/sabre/dav/tests/Sabre/DAV/ServerPluginTest.php b/vendor/sabre/dav/tests/Sabre/DAV/ServerPluginTest.php
index bbf820eb5..47e1e6b4c 100644
--- a/vendor/sabre/dav/tests/Sabre/DAV/ServerPluginTest.php
+++ b/vendor/sabre/dav/tests/Sabre/DAV/ServerPluginTest.php
@@ -6,9 +6,6 @@ namespace Sabre\DAV;
use Sabre\HTTP;
-require_once 'Sabre/DAV/AbstractServer.php';
-require_once 'Sabre/DAV/TestPlugin.php';
-
class ServerPluginTest extends AbstractServer
{
/**
@@ -16,7 +13,7 @@ class ServerPluginTest extends AbstractServer
*/
protected $testPlugin;
- public function setUp()
+ public function setup(): void
{
parent::setUp();
diff --git a/vendor/sabre/dav/tests/Sabre/DAV/ServerPreconditionTest.php b/vendor/sabre/dav/tests/Sabre/DAV/ServerPreconditionTest.php
deleted file mode 100644
index fa88e9095..000000000
--- a/vendor/sabre/dav/tests/Sabre/DAV/ServerPreconditionTest.php
+++ /dev/null
@@ -1,283 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-namespace Sabre\DAV;
-
-use Sabre\HTTP;
-
-require_once 'Sabre/HTTP/ResponseMock.php';
-
-class ServerPreconditionsTest extends \PHPUnit\Framework\TestCase
-{
- /**
- * @expectedException \Sabre\DAV\Exception\PreconditionFailed
- */
- public function testIfMatchNoNode()
- {
- $root = new SimpleCollection('root', [new ServerPreconditionsNode()]);
- $server = new Server($root);
- $httpRequest = new HTTP\Request('GET', '/bar', ['If-Match' => '*']);
- $httpResponse = new HTTP\Response();
- $server->checkPreconditions($httpRequest, $httpResponse);
- }
-
- public function testIfMatchHasNode()
- {
- $root = new SimpleCollection('root', [new ServerPreconditionsNode()]);
- $server = new Server($root);
- $httpRequest = new HTTP\Request('GET', '/foo', ['If-Match' => '*']);
- $httpResponse = new HTTP\Response();
- $this->assertTrue($server->checkPreconditions($httpRequest, $httpResponse));
- }
-
- /**
- * @expectedException \Sabre\DAV\Exception\PreconditionFailed
- */
- public function testIfMatchWrongEtag()
- {
- $root = new SimpleCollection('root', [new ServerPreconditionsNode()]);
- $server = new Server($root);
- $httpRequest = new HTTP\Request('GET', '/foo', ['If-Match' => '1234']);
- $httpResponse = new HTTP\Response();
- $server->checkPreconditions($httpRequest, $httpResponse);
- }
-
- public function testIfMatchCorrectEtag()
- {
- $root = new SimpleCollection('root', [new ServerPreconditionsNode()]);
- $server = new Server($root);
- $httpRequest = new HTTP\Request('GET', '/foo', ['If-Match' => '"abc123"']);
- $httpResponse = new HTTP\Response();
- $this->assertTrue($server->checkPreconditions($httpRequest, $httpResponse));
- }
-
- /**
- * Evolution sometimes uses \" instead of " for If-Match headers.
- *
- * @depends testIfMatchCorrectEtag
- */
- public function testIfMatchEvolutionEtag()
- {
- $root = new SimpleCollection('root', [new ServerPreconditionsNode()]);
- $server = new Server($root);
- $httpRequest = new HTTP\Request('GET', '/foo', ['If-Match' => '\\"abc123\\"']);
- $httpResponse = new HTTP\Response();
- $this->assertTrue($server->checkPreconditions($httpRequest, $httpResponse));
- }
-
- public function testIfMatchMultiple()
- {
- $root = new SimpleCollection('root', [new ServerPreconditionsNode()]);
- $server = new Server($root);
- $httpRequest = new HTTP\Request('GET', '/foo', ['If-Match' => '"hellothere", "abc123"']);
- $httpResponse = new HTTP\Response();
- $this->assertTrue($server->checkPreconditions($httpRequest, $httpResponse));
- }
-
- public function testIfNoneMatchNoNode()
- {
- $root = new SimpleCollection('root', [new ServerPreconditionsNode()]);
- $server = new Server($root);
- $httpRequest = new HTTP\Request('GET', '/bar', ['If-None-Match' => '*']);
- $httpResponse = new HTTP\Response();
- $this->assertTrue($server->checkPreconditions($httpRequest, $httpResponse));
- }
-
- /**
- * @expectedException \Sabre\DAV\Exception\PreconditionFailed
- */
- public function testIfNoneMatchHasNode()
- {
- $root = new SimpleCollection('root', [new ServerPreconditionsNode()]);
- $server = new Server($root);
- $httpRequest = new HTTP\Request('POST', '/foo', ['If-None-Match' => '*']);
- $httpResponse = new HTTP\Response();
- $server->checkPreconditions($httpRequest, $httpResponse);
- }
-
- public function testIfNoneMatchWrongEtag()
- {
- $root = new SimpleCollection('root', [new ServerPreconditionsNode()]);
- $server = new Server($root);
- $httpRequest = new HTTP\Request('POST', '/foo', ['If-None-Match' => '"1234"']);
- $httpResponse = new HTTP\Response();
- $this->assertTrue($server->checkPreconditions($httpRequest, $httpResponse));
- }
-
- public function testIfNoneMatchWrongEtagMultiple()
- {
- $root = new SimpleCollection('root', [new ServerPreconditionsNode()]);
- $server = new Server($root);
- $httpRequest = new HTTP\Request('POST', '/foo', ['If-None-Match' => '"1234", "5678"']);
- $httpResponse = new HTTP\Response();
- $this->assertTrue($server->checkPreconditions($httpRequest, $httpResponse));
- }
-
- /**
- * @expectedException \Sabre\DAV\Exception\PreconditionFailed
- */
- public function testIfNoneMatchCorrectEtag()
- {
- $root = new SimpleCollection('root', [new ServerPreconditionsNode()]);
- $server = new Server($root);
- $httpRequest = new HTTP\Request('POST', '/foo', ['If-None-Match' => '"abc123"']);
- $httpResponse = new HTTP\Response();
- $server->checkPreconditions($httpRequest, $httpResponse);
- }
-
- /**
- * @expectedException \Sabre\DAV\Exception\PreconditionFailed
- */
- public function testIfNoneMatchCorrectEtagMultiple()
- {
- $root = new SimpleCollection('root', [new ServerPreconditionsNode()]);
- $server = new Server($root);
- $httpRequest = new HTTP\Request('POST', '/foo', ['If-None-Match' => '"1234, "abc123"']);
- $httpResponse = new HTTP\Response();
- $server->checkPreconditions($httpRequest, $httpResponse);
- }
-
- public function testIfNoneMatchCorrectEtagAsGet()
- {
- $root = new SimpleCollection('root', [new ServerPreconditionsNode()]);
- $server = new Server($root);
- $httpRequest = new HTTP\Request('GET', '/foo', ['If-None-Match' => '"abc123"']);
- $server->httpResponse = new HTTP\ResponseMock();
-
- $this->assertFalse($server->checkPreconditions($httpRequest, $server->httpResponse));
- $this->assertEquals(304, $server->httpResponse->getStatus());
- $this->assertEquals(['ETag' => ['"abc123"']], $server->httpResponse->getHeaders());
- }
-
- /**
- * This was a test written for issue #515.
- */
- public function testNoneMatchCorrectEtagEnsureSapiSent()
- {
- $root = new SimpleCollection('root', [new ServerPreconditionsNode()]);
- $server = new Server($root);
- $server->sapi = new HTTP\SapiMock();
- HTTP\SapiMock::$sent = 0;
- $httpRequest = new HTTP\Request('GET', '/foo', ['If-None-Match' => '"abc123"']);
- $server->httpRequest = $httpRequest;
- $server->httpResponse = new HTTP\ResponseMock();
-
- $server->exec();
-
- $this->assertFalse($server->checkPreconditions($httpRequest, $server->httpResponse));
- $this->assertEquals(304, $server->httpResponse->getStatus());
- $this->assertEquals([
- 'ETag' => ['"abc123"'],
- 'X-Sabre-Version' => [Version::VERSION],
- ], $server->httpResponse->getHeaders());
- $this->assertEquals(1, HTTP\SapiMock::$sent);
- }
-
- public function testIfModifiedSinceUnModified()
- {
- $root = new SimpleCollection('root', [new ServerPreconditionsNode()]);
- $server = new Server($root);
- $httpRequest = new HTTP\Request('GET', '/foo', [
- 'If-Modified-Since' => 'Sun, 06 Nov 1994 08:49:37 GMT',
- ]);
- $server->httpResponse = new HTTP\ResponseMock();
- $this->assertFalse($server->checkPreconditions($httpRequest, $server->httpResponse));
-
- $this->assertEquals(304, $server->httpResponse->status);
- $this->assertEquals([
- 'Last-Modified' => ['Sat, 06 Apr 1985 23:30:00 GMT'],
- ], $server->httpResponse->getHeaders());
- }
-
- public function testIfModifiedSinceModified()
- {
- $root = new SimpleCollection('root', [new ServerPreconditionsNode()]);
- $server = new Server($root);
- $httpRequest = new HTTP\Request('GET', '/foo', [
- 'If-Modified-Since' => 'Tue, 06 Nov 1984 08:49:37 GMT',
- ]);
-
- $httpResponse = new HTTP\ResponseMock();
- $this->assertTrue($server->checkPreconditions($httpRequest, $httpResponse));
- }
-
- public function testIfModifiedSinceInvalidDate()
- {
- $root = new SimpleCollection('root', [new ServerPreconditionsNode()]);
- $server = new Server($root);
- $httpRequest = new HTTP\Request('GET', '/foo', [
- 'If-Modified-Since' => 'Your mother',
- ]);
- $httpResponse = new HTTP\ResponseMock();
-
- // Invalid dates must be ignored, so this should return true
- $this->assertTrue($server->checkPreconditions($httpRequest, $httpResponse));
- }
-
- public function testIfModifiedSinceInvalidDate2()
- {
- $root = new SimpleCollection('root', [new ServerPreconditionsNode()]);
- $server = new Server($root);
- $httpRequest = new HTTP\Request('GET', '/foo', [
- 'If-Unmodified-Since' => 'Sun, 06 Nov 1994 08:49:37 EST',
- ]);
- $httpResponse = new HTTP\ResponseMock();
- $this->assertTrue($server->checkPreconditions($httpRequest, $httpResponse));
- }
-
- public function testIfUnmodifiedSinceUnModified()
- {
- $root = new SimpleCollection('root', [new ServerPreconditionsNode()]);
- $server = new Server($root);
- $httpRequest = new HTTP\Request('GET', '/foo', [
- 'If-Unmodified-Since' => 'Sun, 06 Nov 1994 08:49:37 GMT',
- ]);
- $httpResponse = new HTTP\Response();
- $this->assertTrue($server->checkPreconditions($httpRequest, $httpResponse));
- }
-
- /**
- * @expectedException \Sabre\DAV\Exception\PreconditionFailed
- */
- public function testIfUnmodifiedSinceModified()
- {
- $root = new SimpleCollection('root', [new ServerPreconditionsNode()]);
- $server = new Server($root);
- $httpRequest = new HTTP\Request('GET', '/foo', [
- 'If-Unmodified-Since' => 'Tue, 06 Nov 1984 08:49:37 GMT',
- ]);
- $httpResponse = new HTTP\ResponseMock();
- $server->checkPreconditions($httpRequest, $httpResponse);
- }
-
- public function testIfUnmodifiedSinceInvalidDate()
- {
- $root = new SimpleCollection('root', [new ServerPreconditionsNode()]);
- $server = new Server($root);
- $httpRequest = new HTTP\Request('GET', '/foo', [
- 'If-Unmodified-Since' => 'Sun, 06 Nov 1984 08:49:37 CET',
- ]);
- $httpResponse = new HTTP\ResponseMock();
- $this->assertTrue($server->checkPreconditions($httpRequest, $httpResponse));
- }
-}
-
-class ServerPreconditionsNode extends File
-{
- public function getETag()
- {
- return '"abc123"';
- }
-
- public function getLastModified()
- {
- /* my birthday & time, I believe */
- return strtotime('1985-04-07 01:30 +02:00');
- }
-
- public function getName()
- {
- return 'foo';
- }
-}
diff --git a/vendor/sabre/dav/tests/Sabre/DAV/ServerPropsTest.php b/vendor/sabre/dav/tests/Sabre/DAV/ServerPropsTest.php
index def9a9cfb..cd1ccfa53 100644
--- a/vendor/sabre/dav/tests/Sabre/DAV/ServerPropsTest.php
+++ b/vendor/sabre/dav/tests/Sabre/DAV/ServerPropsTest.php
@@ -6,9 +6,6 @@ namespace Sabre\DAV;
use Sabre\HTTP;
-require_once 'Sabre/HTTP/ResponseMock.php';
-require_once 'Sabre/DAV/AbstractServer.php';
-
class ServerPropsTest extends AbstractServer
{
protected function getRootNode()
@@ -16,7 +13,7 @@ class ServerPropsTest extends AbstractServer
return new FSExt\Directory(SABRE_TEMPDIR);
}
- public function setUp()
+ public function setup(): void
{
if (file_exists(SABRE_TEMPDIR.'../.sabredav')) {
unlink(SABRE_TEMPDIR.'../.sabredav');
@@ -28,7 +25,7 @@ class ServerPropsTest extends AbstractServer
$this->server->addPlugin(new Locks\Plugin(new Locks\Backend\File(SABRE_TEMPDIR.'/.locksdb')));
}
- public function tearDown()
+ public function teardown(): void
{
parent::tearDown();
if (file_exists(SABRE_TEMPDIR.'../.locksdb')) {
diff --git a/vendor/sabre/dav/tests/Sabre/DAV/ServerRangeTest.php b/vendor/sabre/dav/tests/Sabre/DAV/ServerRangeTest.php
index 93ea083d8..6d5be4608 100644
--- a/vendor/sabre/dav/tests/Sabre/DAV/ServerRangeTest.php
+++ b/vendor/sabre/dav/tests/Sabre/DAV/ServerRangeTest.php
@@ -23,7 +23,7 @@ class ServerRangeTest extends \Sabre\DAVServerTest
*/
protected $lastModified;
- public function setUp()
+ public function setup(): void
{
parent::setUp();
$this->server->createFile('files/test.txt', 'Test contents');
@@ -133,7 +133,7 @@ class ServerRangeTest extends \Sabre\DAVServerTest
$request = new HTTP\Request('GET', '/files/no-seeking.txt', ['Range' => 'bytes=2-5']);
$response = $this->request($request);
- $this->assertEquals(206, $response->getStatus(), $response);
+ $this->assertEquals(206, $response->getStatus());
$this->assertEquals([
'X-Sabre-Version' => [Version::VERSION],
'Content-Type' => ['application/octet-stream'],
diff --git a/vendor/sabre/dav/tests/Sabre/DAV/ServerSimpleTest.php b/vendor/sabre/dav/tests/Sabre/DAV/ServerSimpleTest.php
index 563f558eb..e4dd3cdb6 100644
--- a/vendor/sabre/dav/tests/Sabre/DAV/ServerSimpleTest.php
+++ b/vendor/sabre/dav/tests/Sabre/DAV/ServerSimpleTest.php
@@ -18,11 +18,9 @@ class ServerSimpleTest extends AbstractServer
$this->assertEquals($nodes[0], $server->tree->getNodeForPath('hello'));
}
- /**
- * @expectedException \Sabre\DAV\Exception
- */
public function testConstructInvalidArg()
{
+ $this->expectException('Sabre\DAV\Exception');
$server = new Server(1);
}
@@ -189,11 +187,9 @@ class ServerSimpleTest extends AbstractServer
}
}
- /**
- * @expectedException \Sabre\DAV\Exception\Forbidden
- */
public function testCalculateUriBreakout()
{
+ $this->expectException('Sabre\DAV\Exception\Forbidden');
$uri = '/path1/';
$this->server->setBaseUri('/path2/');
@@ -311,10 +307,10 @@ class ServerSimpleTest extends AbstractServer
/**
* @depends testGuessBaseUri
- * @expectedException \Sabre\DAV\Exception
*/
public function testGuessBaseUriBadConfig()
{
+ $this->expectException('Sabre\DAV\Exception');
$serverVars = [
'REQUEST_METHOD' => 'GET',
'REQUEST_URI' => '/index.php/root/heyyy',
diff --git a/vendor/sabre/dav/tests/Sabre/DAV/StringUtilTest.php b/vendor/sabre/dav/tests/Sabre/DAV/StringUtilTest.php
index 1e4b92197..bc36c6b78 100644
--- a/vendor/sabre/dav/tests/Sabre/DAV/StringUtilTest.php
+++ b/vendor/sabre/dav/tests/Sabre/DAV/StringUtilTest.php
@@ -72,19 +72,15 @@ class StringUtilTest extends \PHPUnit\Framework\TestCase
];
}
- /**
- * @expectedException \Sabre\DAV\Exception\BadRequest
- */
public function testBadCollation()
{
+ $this->expectException('Sabre\DAV\Exception\BadRequest');
StringUtil::textMatch('foobar', 'foo', 'blabla', 'contains');
}
- /**
- * @expectedException \Sabre\DAV\Exception\BadRequest
- */
public function testBadMatchType()
{
+ $this->expectException('Sabre\DAV\Exception\BadRequest');
StringUtil::textMatch('foobar', 'foo', 'i;octet', 'booh');
}
diff --git a/vendor/sabre/dav/tests/Sabre/DAV/TemporaryFileFilterTest.php b/vendor/sabre/dav/tests/Sabre/DAV/TemporaryFileFilterTest.php
index bae5b58bf..951078bf0 100644
--- a/vendor/sabre/dav/tests/Sabre/DAV/TemporaryFileFilterTest.php
+++ b/vendor/sabre/dav/tests/Sabre/DAV/TemporaryFileFilterTest.php
@@ -8,7 +8,7 @@ use Sabre\HTTP;
class TemporaryFileFilterTest extends AbstractServer
{
- public function setUp()
+ public function setup(): void
{
parent::setUp();
$plugin = new TemporaryFileFilterPlugin(SABRE_TEMPDIR.'/tff');
diff --git a/vendor/sabre/dav/tests/Sabre/DAV/TreeTest.php b/vendor/sabre/dav/tests/Sabre/DAV/TreeTest.php
index 51ff5ccde..e3f04ea3a 100644
--- a/vendor/sabre/dav/tests/Sabre/DAV/TreeTest.php
+++ b/vendor/sabre/dav/tests/Sabre/DAV/TreeTest.php
@@ -203,8 +203,6 @@ class TreeFileTester extends File implements IProperties
*
* To update specific properties, call the 'handle' method on this object.
* Read the PropPatch documentation for more information.
- *
- * @param PropPatch $propPatch
*/
public function propPatch(PropPatch $propPatch)
{
@@ -221,8 +219,6 @@ class TreeMultiGetTester extends TreeDirectoryTester implements IMultiGet
*
* If any children are not found, you do not have to return them.
*
- * @param array $paths
- *
* @return array
*/
public function getMultipleChildren(array $paths)