fix tests
Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
parent
4025b95e03
commit
a004eedd1e
|
@ -32,6 +32,7 @@ use OC\Files\FileInfo;
|
||||||
use OC\Files\Storage\Wrapper\Quota;
|
use OC\Files\Storage\Wrapper\Quota;
|
||||||
use OCA\DAV\Connector\Sabre\Directory;
|
use OCA\DAV\Connector\Sabre\Directory;
|
||||||
use OCP\Files\ForbiddenException;
|
use OCP\Files\ForbiddenException;
|
||||||
|
use OCP\Files\Mount\IMountPoint;
|
||||||
|
|
||||||
class TestViewDirectory extends \OC\Files\View {
|
class TestViewDirectory extends \OC\Files\View {
|
||||||
private $updatables;
|
private $updatables;
|
||||||
|
@ -269,9 +270,12 @@ class DirectoryTest extends \Test\TestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testGetQuotaInfoUnlimited() {
|
public function testGetQuotaInfoUnlimited() {
|
||||||
|
$mountPoint = $this->createMock(IMountPoint::class);
|
||||||
$storage = $this->getMockBuilder(Quota::class)
|
$storage = $this->getMockBuilder(Quota::class)
|
||||||
->disableOriginalConstructor()
|
->disableOriginalConstructor()
|
||||||
->getMock();
|
->getMock();
|
||||||
|
$mountPoint->method('getStorage')
|
||||||
|
->willReturn($storage);
|
||||||
|
|
||||||
$storage->expects($this->any())
|
$storage->expects($this->any())
|
||||||
->method('instanceOfStorage')
|
->method('instanceOfStorage')
|
||||||
|
@ -292,8 +296,8 @@ class DirectoryTest extends \Test\TestCase {
|
||||||
->willReturn(200);
|
->willReturn(200);
|
||||||
|
|
||||||
$this->info->expects($this->once())
|
$this->info->expects($this->once())
|
||||||
->method('getStorage')
|
->method('getMountPoint')
|
||||||
->willReturn($storage);
|
->willReturn($mountPoint);
|
||||||
|
|
||||||
$this->view->expects($this->once())
|
$this->view->expects($this->once())
|
||||||
->method('getFileInfo')
|
->method('getFileInfo')
|
||||||
|
@ -304,9 +308,12 @@ class DirectoryTest extends \Test\TestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testGetQuotaInfoSpecific() {
|
public function testGetQuotaInfoSpecific() {
|
||||||
|
$mountPoint = $this->createMock(IMountPoint::class);
|
||||||
$storage = $this->getMockBuilder(Quota::class)
|
$storage = $this->getMockBuilder(Quota::class)
|
||||||
->disableOriginalConstructor()
|
->disableOriginalConstructor()
|
||||||
->getMock();
|
->getMock();
|
||||||
|
$mountPoint->method('getStorage')
|
||||||
|
->willReturn($storage);
|
||||||
|
|
||||||
$storage->expects($this->any())
|
$storage->expects($this->any())
|
||||||
->method('instanceOfStorage')
|
->method('instanceOfStorage')
|
||||||
|
@ -328,8 +335,8 @@ class DirectoryTest extends \Test\TestCase {
|
||||||
->willReturn(200);
|
->willReturn(200);
|
||||||
|
|
||||||
$this->info->expects($this->once())
|
$this->info->expects($this->once())
|
||||||
->method('getStorage')
|
->method('getMountPoint')
|
||||||
->willReturn($storage);
|
->willReturn($mountPoint);
|
||||||
|
|
||||||
$this->view->expects($this->once())
|
$this->view->expects($this->once())
|
||||||
->method('getFileInfo')
|
->method('getFileInfo')
|
||||||
|
|
Loading…
Reference in New Issue