diff options
Diffstat (limited to 'apps/dav/tests/unit/Connector/Sabre/FileTest.php')
-rw-r--r-- | apps/dav/tests/unit/Connector/Sabre/FileTest.php | 24 |
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'; |