nextcloud/apps/files_external/tests/PersonalMountTest.php

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

40 lines
1.2 KiB
PHP
Raw Normal View History

2015-12-08 12:01:44 -05:00
<?php
/**
* SPDX-FileCopyrightText: 2019-2024 Nextcloud GmbH and Nextcloud contributors
* SPDX-FileCopyrightText: 2016 ownCloud, Inc.
* SPDX-License-Identifier: AGPL-3.0-only
2015-12-08 12:01:44 -05:00
*/
2016-05-13 05:56:47 -04:00
namespace OCA\Files_External\Tests;
2015-12-08 12:01:44 -05:00
use OC\Files\Mount\Manager;
use OC\Files\SetupManagerFactory;
2015-12-08 12:01:44 -05:00
use OCA\Files_External\Lib\PersonalMount;
use OCA\Files_External\Lib\StorageConfig;
use OCA\Files_External\Service\UserStoragesService;
2015-12-08 12:01:44 -05:00
use Test\TestCase;
class PersonalMountTest extends TestCase {
public function testFindByStorageId(): void {
$storageConfig = $this->createMock(StorageConfig::class);
/** @var UserStoragesService $storageService */
2015-12-08 12:01:44 -05:00
$storageService = $this->getMockBuilder('\OCA\Files_External\Service\UserStoragesService')
->disableOriginalConstructor()
->getMock();
$storage = $this->getMockBuilder('\OC\Files\Storage\Storage')
->disableOriginalConstructor()
->getMock();
$storage->expects($this->any())
->method('getId')
->willReturn('dummy');
2015-12-08 12:01:44 -05:00
$mount = new PersonalMount($storageService, $storageConfig, 10, $storage, '/foo');
2015-12-08 12:01:44 -05:00
$mountManager = new Manager($this->createMock(SetupManagerFactory::class));
2015-12-08 12:01:44 -05:00
$mountManager->addMount($mount);
$this->assertEquals([$mount], $mountManager->findByStorageId('dummy'));
}
}