use OCP\ICacheFactory;
use OCP\IConfig;
use OCP\IUser;
+use Psr\Log\LoggerInterface;
use Test\TestCase;
/**
private $cacheFactory;
/** @var ICache */
private $cache;
+ /** @var LoggerInterface */
+ private $logger;
protected function setUp(): void {
parent::setUp();
$this->eventDispatcher = $this->createMock(IEventDispatcher::class);
$this->cacheFactory = $this->createMock(ICacheFactory::class);
$this->cache = $this->createMock(ICache::class);
+ $this->logger = $this->createMock(LoggerInterface::class);
$this->cacheFactory->method('createDistributed')
->willReturn($this->cache);
public function testGetBackends() {
$userDummyBackend = $this->createMock(\Test\Util\User\Dummy::class);
- $manager = new \OC\User\Manager($this->config, $this->cacheFactory, $this->eventDispatcher);
+ $manager = new \OC\User\Manager($this->config, $this->cacheFactory, $this->eventDispatcher, $this->logger);
$manager->registerBackend($userDummyBackend);
$this->assertEquals([$userDummyBackend], $manager->getBackends());
$dummyDatabaseBackend = $this->createMock(Database::class);
->with($this->equalTo('foo'))
->willReturn(true);
- $manager = new \OC\User\Manager($this->config, $this->cacheFactory, $this->eventDispatcher);
+ $manager = new \OC\User\Manager($this->config, $this->cacheFactory, $this->eventDispatcher, $this->logger);
$manager->registerBackend($backend);
$this->assertTrue($manager->userExists('foo'));
->with($this->equalTo('foo'))
->willReturn(false);
- $manager = new \OC\User\Manager($this->config, $this->cacheFactory, $this->eventDispatcher);
+ $manager = new \OC\User\Manager($this->config, $this->cacheFactory, $this->eventDispatcher, $this->logger);
$manager->registerBackend($backend);
$this->assertFalse($manager->userExists('foo'));
}
public function testUserExistsNoBackends() {
- $manager = new \OC\User\Manager($this->config, $this->cacheFactory, $this->eventDispatcher);
+ $manager = new \OC\User\Manager($this->config, $this->cacheFactory, $this->eventDispatcher, $this->logger);
$this->assertFalse($manager->userExists('foo'));
}
->with($this->equalTo('foo'))
->willReturn(true);
- $manager = new \OC\User\Manager($this->config, $this->cacheFactory, $this->eventDispatcher);
+ $manager = new \OC\User\Manager($this->config, $this->cacheFactory, $this->eventDispatcher, $this->logger);
$manager->registerBackend($backend1);
$manager->registerBackend($backend2);
$backend2->expects($this->never())
->method('userExists');
- $manager = new \OC\User\Manager($this->config, $this->cacheFactory, $this->eventDispatcher);
+ $manager = new \OC\User\Manager($this->config, $this->cacheFactory, $this->eventDispatcher, $this->logger);
$manager->registerBackend($backend1);
$manager->registerBackend($backend2);
}
});
- $manager = new \OC\User\Manager($this->config, $this->cacheFactory, $this->eventDispatcher);
+ $manager = new \OC\User\Manager($this->config, $this->cacheFactory, $this->eventDispatcher, $this->logger);
$manager->registerBackend($backend);
$user = $manager->checkPassword('foo', 'bar');
->method('implementsActions')
->willReturn(false);
- $manager = new \OC\User\Manager($this->config, $this->cacheFactory, $this->eventDispatcher);
+ $manager = new \OC\User\Manager($this->config, $this->cacheFactory, $this->eventDispatcher, $this->logger);
$manager->registerBackend($backend);
$this->assertFalse($manager->checkPassword('foo', 'bar'));
$backend->expects($this->never())
->method('loginName2UserName');
- $manager = new \OC\User\Manager($this->config, $this->cacheFactory, $this->eventDispatcher);
+ $manager = new \OC\User\Manager($this->config, $this->cacheFactory, $this->eventDispatcher, $this->logger);
$manager->registerBackend($backend);
$this->assertEquals('foo', $manager->get('foo')->getUID());
->with($this->equalTo('foo'))
->willReturn(false);
- $manager = new \OC\User\Manager($this->config, $this->cacheFactory, $this->eventDispatcher);
+ $manager = new \OC\User\Manager($this->config, $this->cacheFactory, $this->eventDispatcher, $this->logger);
$manager->registerBackend($backend);
$this->assertEquals(null, $manager->get('foo'));
$backend->expects($this->never())
->method('loginName2UserName');
- $manager = new \OC\User\Manager($this->config, $this->cacheFactory, $this->eventDispatcher);
+ $manager = new \OC\User\Manager($this->config, $this->cacheFactory, $this->eventDispatcher, $this->logger);
$manager->registerBackend($backend);
$this->assertEquals('bLeNdEr', $manager->get('bLeNdEr')->getUID());
$backend->expects($this->never())
->method('loginName2UserName');
- $manager = new \OC\User\Manager($this->config, $this->cacheFactory, $this->eventDispatcher);
+ $manager = new \OC\User\Manager($this->config, $this->cacheFactory, $this->eventDispatcher, $this->logger);
$manager->registerBackend($backend);
$result = $manager->search('fo');
$backend2->expects($this->never())
->method('loginName2UserName');
- $manager = new \OC\User\Manager($this->config, $this->cacheFactory, $this->eventDispatcher);
+ $manager = new \OC\User\Manager($this->config, $this->cacheFactory, $this->eventDispatcher, $this->logger);
$manager->registerBackend($backend1);
$manager->registerBackend($backend2);
->willReturn(true);
- $manager = new \OC\User\Manager($this->config, $this->cacheFactory, $this->eventDispatcher);
+ $manager = new \OC\User\Manager($this->config, $this->cacheFactory, $this->eventDispatcher, $this->logger);
$manager->registerBackend($backend);
$this->expectException(\InvalidArgumentException::class, $exception);
$backend->expects($this->never())
->method('loginName2UserName');
- $manager = new \OC\User\Manager($this->config, $this->cacheFactory, $this->eventDispatcher);
+ $manager = new \OC\User\Manager($this->config, $this->cacheFactory, $this->eventDispatcher, $this->logger);
$manager->registerBackend($backend);
$user = $manager->createUser('foo', 'bar');
->with($this->equalTo('foo'))
->willReturn(true);
- $manager = new \OC\User\Manager($this->config, $this->cacheFactory, $this->eventDispatcher);
+ $manager = new \OC\User\Manager($this->config, $this->cacheFactory, $this->eventDispatcher, $this->logger);
$manager->registerBackend($backend);
$manager->createUser('foo', 'bar');
$backend->expects($this->never())
->method('userExists');
- $manager = new \OC\User\Manager($this->config, $this->cacheFactory, $this->eventDispatcher);
+ $manager = new \OC\User\Manager($this->config, $this->cacheFactory, $this->eventDispatcher, $this->logger);
$manager->registerBackend($backend);
$this->assertFalse($manager->createUser('foo', 'bar'));
}
public function testCreateUserNoBackends() {
- $manager = new \OC\User\Manager($this->config, $this->cacheFactory, $this->eventDispatcher);
+ $manager = new \OC\User\Manager($this->config, $this->cacheFactory, $this->eventDispatcher, $this->logger);
$this->assertFalse($manager->createUser('foo', 'bar'));
}
->with('MyUid', 'MyPassword')
->willReturn(false);
- $manager = new Manager($this->config, $this->cacheFactory, $this->eventDispatcher);
+ $manager = new Manager($this->config, $this->cacheFactory, $this->eventDispatcher, $this->logger);
$manager->createUserFromBackend('MyUid', 'MyPassword', $backend);
}
->with($this->equalTo('foo'))
->willReturn(true);
- $manager = new \OC\User\Manager($this->config, $this->cacheFactory, $this->eventDispatcher);
+ $manager = new \OC\User\Manager($this->config, $this->cacheFactory, $this->eventDispatcher, $this->logger);
$manager->registerBackend($backend1);
$manager->registerBackend($backend2);
}
public function testCountUsersNoBackend() {
- $manager = new \OC\User\Manager($this->config, $this->cacheFactory, $this->eventDispatcher);
+ $manager = new \OC\User\Manager($this->config, $this->cacheFactory, $this->eventDispatcher, $this->logger);
$result = $manager->countUsers();
$this->assertTrue(is_array($result));
->method('getBackendName')
->willReturn('Mock_Test_Util_User_Dummy');
- $manager = new \OC\User\Manager($this->config, $this->cacheFactory, $this->eventDispatcher);
+ $manager = new \OC\User\Manager($this->config, $this->cacheFactory, $this->eventDispatcher, $this->logger);
$manager->registerBackend($backend);
$result = $manager->countUsers();
->method('getBackendName')
->willReturn('Mock_Test_Util_User_Dummy');
- $manager = new \OC\User\Manager($this->config, $this->cacheFactory, $this->eventDispatcher);
+ $manager = new \OC\User\Manager($this->config, $this->cacheFactory, $this->eventDispatcher, $this->logger);
$manager->registerBackend($backend1);
$manager->registerBackend($backend2);
->method('getAppValue')
->willReturnArgument(2);
- $manager = new \OC\User\Manager($config, $this->cacheFactory, $this->eventDispatcher);
+ $manager = new \OC\User\Manager($config, $this->cacheFactory, $this->eventDispatcher, $this->logger);
$backend = new \Test\Util\User\Dummy();
$manager->registerBackend($backend);
true
);
- $manager = new \OC\User\Manager($config, $this->cacheFactory, $this->eventDispatcher);
+ $manager = new \OC\User\Manager($config, $this->cacheFactory, $this->eventDispatcher, $this->logger);
$manager->registerBackend($backend);
$users = $manager->getByEmail('test@example.com');
$this->config,
$this->createMock(ICacheFactory::class),
$this->createMock(IEventDispatcher::class),
+ $this->createMock(LoggerInterface::class),
])
->getMock();
$this->config,
$this->createMock(ICacheFactory::class),
$this->createMock(IEventDispatcher::class),
+ $this->createMock(LoggerInterface::class),
])
->getMock();
$this->config,
$this->createMock(ICacheFactory::class),
$this->createMock(IEventDispatcher::class),
+ $this->createMock(LoggerInterface::class),
])
->getMock();
$backend = $this->createMock(\Test\Util\User\Dummy::class);
$this->config,
$this->createMock(ICacheFactory::class),
$this->createMock(IEventDispatcher::class),
+ $this->createMock(LoggerInterface::class),
])
->getMock();
$userSession = new Session($manager, $session, $this->timeFactory, $this->tokenProvider, $this->config, $this->random, $this->lockdownManager, $this->logger, $this->dispatcher);
$this->config,
$this->createMock(ICacheFactory::class),
$this->createMock(IEventDispatcher::class),
+ $this->createMock(LoggerInterface::class),
])
->getMock();
$userSession = new Session($manager, $session, $this->timeFactory, $this->tokenProvider, $this->config, $this->random, $this->lockdownManager, $this->logger, $this->dispatcher);
$this->config,
$this->createMock(ICacheFactory::class),
$this->createMock(IEventDispatcher::class),
+ $this->createMock(LoggerInterface::class),
])
->getMock();
$userSession = $this->getMockBuilder(Session::class)
$this->config,
$this->createMock(ICacheFactory::class),
$this->createMock(IEventDispatcher::class),
+ $this->createMock(LoggerInterface::class),
])
->getMock();
$userSession = $this->getMockBuilder(Session::class)
$this->config,
$this->createMock(ICacheFactory::class),
$this->createMock(IEventDispatcher::class),
+ $this->createMock(LoggerInterface::class),
])
->getMock();
$userSession = $this->getMockBuilder(Session::class)
$this->config,
$this->createMock(ICacheFactory::class),
$this->createMock(IEventDispatcher::class),
+ $this->createMock(LoggerInterface::class),
])
->getMock();
$userSession = $this->getMockBuilder(Session::class)