summaryrefslogtreecommitdiffstats
path: root/apps/dav
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2022-08-26 08:34:15 +0200
committerVincent Petry (Rebase PR Action) <PVince81@users.noreply.github.com>2022-12-16 17:15:21 +0000
commit174634448195a3b4593a4139a3043f5251a055ee (patch)
tree0dfd10fb0ad631c07dd34cb287b45d3ff509b20b /apps/dav
parent3b7cc31f64d7feae07b424f977f6963d12da012d (diff)
downloadnextcloud-server-174634448195a3b4593a4139a3043f5251a055ee.tar.gz
nextcloud-server-174634448195a3b4593a4139a3043f5251a055ee.zip
Use display name cache on getStorageInfo
Signed-off-by: Julius Härtl <jus@bitgrid.net> Adapt test to also run isolated Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'apps/dav')
-rw-r--r--apps/dav/tests/unit/Connector/Sabre/DirectoryTest.php15
1 files changed, 15 insertions, 0 deletions
diff --git a/apps/dav/tests/unit/Connector/Sabre/DirectoryTest.php b/apps/dav/tests/unit/Connector/Sabre/DirectoryTest.php
index e8297c2ac66..1de82484ac4 100644
--- a/apps/dav/tests/unit/Connector/Sabre/DirectoryTest.php
+++ b/apps/dav/tests/unit/Connector/Sabre/DirectoryTest.php
@@ -34,6 +34,7 @@ use OC\Files\Storage\Wrapper\Quota;
use OCA\DAV\Connector\Sabre\Directory;
use OCP\Files\ForbiddenException;
use OCP\Files\Mount\IMountPoint;
+use Test\Traits\UserTrait;
class TestViewDirectory extends \OC\Files\View {
private $updatables;
@@ -73,6 +74,8 @@ class TestViewDirectory extends \OC\Files\View {
*/
class DirectoryTest extends \Test\TestCase {
+ use UserTrait;
+
/** @var \OC\Files\View | \PHPUnit\Framework\MockObject\MockObject */
private $view;
/** @var \OC\Files\FileInfo | \PHPUnit\Framework\MockObject\MockObject */
@@ -274,6 +277,8 @@ class DirectoryTest extends \Test\TestCase {
}
public function testGetQuotaInfoUnlimited() {
+ self::createUser('user', 'password');
+ self::loginAsUser('user');
$mountPoint = $this->createMock(IMountPoint::class);
$storage = $this->getMockBuilder(Quota::class)
->disableOriginalConstructor()
@@ -288,6 +293,10 @@ class DirectoryTest extends \Test\TestCase {
'\OC\Files\Storage\Wrapper\Quota' => false,
]);
+ $storage->expects($this->once())
+ ->method('getOwner')
+ ->willReturn('user');
+
$storage->expects($this->never())
->method('getQuota');
@@ -311,6 +320,8 @@ class DirectoryTest extends \Test\TestCase {
}
public function testGetQuotaInfoSpecific() {
+ self::createUser('user', 'password');
+ self::loginAsUser('user');
$mountPoint = $this->createMock(IMountPoint::class);
$storage = $this->getMockBuilder(Quota::class)
->disableOriginalConstructor()
@@ -326,6 +337,10 @@ class DirectoryTest extends \Test\TestCase {
]);
$storage->expects($this->once())
+ ->method('getOwner')
+ ->willReturn('user');
+
+ $storage->expects($this->once())
->method('getQuota')
->willReturn(1000);