aboutsummaryrefslogtreecommitdiffstats
path: root/apps/dav/tests/unit/Direct/DirectHomeTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/dav/tests/unit/Direct/DirectHomeTest.php')
-rw-r--r--apps/dav/tests/unit/Direct/DirectHomeTest.php56
1 files changed, 12 insertions, 44 deletions
diff --git a/apps/dav/tests/unit/Direct/DirectHomeTest.php b/apps/dav/tests/unit/Direct/DirectHomeTest.php
index 0d0203509ff..94c82c2b7c5 100644
--- a/apps/dav/tests/unit/Direct/DirectHomeTest.php
+++ b/apps/dav/tests/unit/Direct/DirectHomeTest.php
@@ -3,29 +3,10 @@
declare(strict_types=1);
/**
- * @copyright 2018, Roeland Jago Douma <roeland@famdouma.nl>
- *
- * @author Morris Jobke <hey@morrisjobke.de>
- * @author Robin Appelman <robin@icewind.nl>
- * @author Roeland Jago Douma <roeland@famdouma.nl>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
+ * SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
-namespace OCA\DAV\Tests\Unit\Direct;
+namespace OCA\DAV\Tests\unit\Direct;
use OCA\DAV\Db\Direct;
use OCA\DAV\Db\DirectMapper;
@@ -37,33 +18,20 @@ use OCP\EventDispatcher\IEventDispatcher;
use OCP\Files\IRootFolder;
use OCP\IRequest;
use OCP\Security\Bruteforce\IThrottler;
+use PHPUnit\Framework\MockObject\MockObject;
use Sabre\DAV\Exception\Forbidden;
use Sabre\DAV\Exception\MethodNotAllowed;
use Sabre\DAV\Exception\NotFound;
use Test\TestCase;
class DirectHomeTest extends TestCase {
-
- /** @var DirectMapper|\PHPUnit\Framework\MockObject\MockObject */
- private $directMapper;
-
- /** @var IRootFolder|\PHPUnit\Framework\MockObject\MockObject */
- private $rootFolder;
-
- /** @var ITimeFactory|\PHPUnit\Framework\MockObject\MockObject */
- private $timeFactory;
-
- /** @var IThrottler|\PHPUnit\Framework\MockObject\MockObject */
- private $throttler;
-
- /** @var IRequest */
- private $request;
-
- /** @var DirectHome */
- private $directHome;
-
- /** @var IEventDispatcher */
- private $eventDispatcher;
+ private DirectMapper&MockObject $directMapper;
+ private IRootFolder&MockObject $rootFolder;
+ private ITimeFactory&MockObject $timeFactory;
+ private IThrottler&MockObject $throttler;
+ private IRequest&MockObject $request;
+ private IEventDispatcher&MockObject $eventDispatcher;
+ private DirectHome $directHome;
protected function setUp(): void {
parent::setUp();
@@ -179,7 +147,7 @@ class DirectHomeTest extends TestCase {
'1.2.3.4'
);
$this->throttler->expects($this->once())
- ->method('sleepDelay')
+ ->method('sleepDelayOrThrowOnMax')
->with(
'1.2.3.4',
'directlink'