mirror of
https://github.com/nextcloud/server.git
synced 2026-04-01 15:18:09 -04:00
Make mock config return default value to fix warnings
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
parent
25fa0b8acd
commit
cd72045433
2 changed files with 25 additions and 2 deletions
|
|
@ -47,7 +47,18 @@ class UserMountCacheTest extends TestCase {
|
|||
protected function setUp(): void {
|
||||
$this->fileIds = [];
|
||||
$this->connection = \OC::$server->getDatabaseConnection();
|
||||
$this->userManager = new Manager($this->createMock(IConfig::class), $this->createMock(EventDispatcherInterface::class), $this->createMock(ICacheFactory::class), $this->createMock(IEventDispatcher::class));
|
||||
$config = $this->getMockBuilder(IConfig::class)
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
$config
|
||||
->expects($this->any())
|
||||
->method('getUserValue')
|
||||
->willReturnArgument(3);
|
||||
$config
|
||||
->expects($this->any())
|
||||
->method('getAppValue')
|
||||
->willReturnArgument(2);
|
||||
$this->userManager = new Manager($config, $this->createMock(EventDispatcherInterface::class), $this->createMock(ICacheFactory::class), $this->createMock(IEventDispatcher::class));
|
||||
$userBackend = new Dummy();
|
||||
$userBackend->createUser('u1', '');
|
||||
$userBackend->createUser('u2', '');
|
||||
|
|
|
|||
|
|
@ -667,7 +667,19 @@ class ManagerTest extends TestCase {
|
|||
}
|
||||
|
||||
public function testDeleteUser() {
|
||||
$manager = new \OC\User\Manager($this->config, $this->oldDispatcher, $this->cacheFactory, $this->eventDispatcher);
|
||||
$config = $this->getMockBuilder(AllConfig::class)
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
$config
|
||||
->expects($this->any())
|
||||
->method('getUserValue')
|
||||
->willReturnArgument(3);
|
||||
$config
|
||||
->expects($this->any())
|
||||
->method('getAppValue')
|
||||
->willReturnArgument(2);
|
||||
|
||||
$manager = new \OC\User\Manager($config, $this->oldDispatcher, $this->cacheFactory, $this->eventDispatcher);
|
||||
$backend = new \Test\Util\User\Dummy();
|
||||
|
||||
$manager->registerBackend($backend);
|
||||
|
|
|
|||
Loading…
Reference in a new issue