Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/apps/dav
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2022-02-23 12:40:58 +0300
committerJoas Schilling <coding@schilljs.com>2022-02-23 13:01:58 +0300
commitd078d536835fc75a79b5381a628cefb92ae74886 (patch)
tree65dac66485b3562fa04f8fce4fabcac69a36ce74 /apps/dav
parentcc6653e45c86e8019846274b04154c96e34632cf (diff)
Fix tests
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps/dav')
-rw-r--r--apps/dav/tests/unit/Connector/Sabre/FileTest.php24
1 files changed, 12 insertions, 12 deletions
diff --git a/apps/dav/tests/unit/Connector/Sabre/FileTest.php b/apps/dav/tests/unit/Connector/Sabre/FileTest.php
index 3e6a47d5854..d12a86f6e8d 100644
--- a/apps/dav/tests/unit/Connector/Sabre/FileTest.php
+++ b/apps/dav/tests/unit/Connector/Sabre/FileTest.php
@@ -35,14 +35,14 @@ use OC\Files\Storage\Local;
use OC\Files\Storage\Temporary;
use OC\Files\Storage\Wrapper\PermissionsMask;
use OC\Files\View;
-use OC\Security\SecureRandom;
use OCA\DAV\Connector\Sabre\File;
use OCP\Constants;
use OCP\Files\ForbiddenException;
use OCP\Files\Storage;
use OCP\IConfig;
+use OCP\IRequestId;
use OCP\Lock\ILockingProvider;
-use OCP\Security\ISecureRandom;
+use PHPUnit\Framework\MockObject\MockObject;
use Test\HookHelper;
use Test\TestCase;
use Test\Traits\MountProviderTrait;
@@ -64,11 +64,11 @@ class FileTest extends TestCase {
*/
private $user;
- /** @var IConfig | \PHPUnit\Framework\MockObject\MockObject */
+ /** @var IConfig|MockObject */
protected $config;
- /** @var ISecureRandom */
- protected $secureRandom;
+ /** @var IRequestId|MockObject */
+ protected $requestId;
protected function setUp(): void {
parent::setUp();
@@ -83,8 +83,8 @@ class FileTest extends TestCase {
$this->loginAsUser($this->user);
- $this->config = $this->getMockBuilder('\OCP\IConfig')->getMock();
- $this->secureRandom = new SecureRandom();
+ $this->config = $this->createMock(IConfig::class);
+ $this->requestId = $this->createMock(IRequestId::class);
}
protected function tearDown(): void {
@@ -96,7 +96,7 @@ class FileTest extends TestCase {
}
/**
- * @return \PHPUnit\Framework\MockObject\MockObject|Storage
+ * @return MockObject|Storage
*/
private function getMockStorage() {
$storage = $this->getMockBuilder(Storage::class)
@@ -184,7 +184,7 @@ class FileTest extends TestCase {
->setConstructorArgs([['datadir' => \OC::$server->getTempManager()->getTemporaryFolder()]])
->getMock();
\OC\Files\Filesystem::mount($storage, [], $this->user . '/');
- /** @var View | \PHPUnit\Framework\MockObject\MockObject $view */
+ /** @var View | MockObject $view */
$view = $this->getMockBuilder(View::class)
->setMethods(['getRelativePath', 'resolvePath'])
->getMock();
@@ -330,7 +330,7 @@ class FileTest extends TestCase {
null
);
- /** @var \OCA\DAV\Connector\Sabre\File | \PHPUnit\Framework\MockObject\MockObject $file */
+ /** @var \OCA\DAV\Connector\Sabre\File | MockObject $file */
$file = $this->getMockBuilder(\OCA\DAV\Connector\Sabre\File::class)
->setConstructorArgs([$view, $info, null, $request])
->setMethods(['header'])
@@ -416,7 +416,7 @@ class FileTest extends TestCase {
'server' => [
'HTTP_X_OC_MTIME' => $requestMtime,
]
- ], $this->secureRandom, $this->config, null);
+ ], $this->requestId, $this->config, null);
$file = 'foo.txt';
if ($resultMtime === null) {
@@ -439,7 +439,7 @@ class FileTest extends TestCase {
'server' => [
'HTTP_X_OC_MTIME' => $requestMtime,
]
- ], $this->secureRandom, $this->config, null);
+ ], $this->requestId, $this->config, null);
$_SERVER['HTTP_OC_CHUNKED'] = true;
$file = 'foo.txt';