本文整理汇总了PHP中OCP\IUser::method方法的典型用法代码示例。如果您正苦于以下问题:PHP IUser::method方法的具体用法?PHP IUser::method怎么用?PHP IUser::method使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OCP\IUser
的用法示例。
在下文中一共展示了IUser::method方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setUp
protected function setUp()
{
parent::setUp();
$this->createUser('userid', 'pass');
$this->loginAsUser('userid');
$app = new Application();
$this->container = $app->getContainer();
$this->container['AppName'] = 'core';
$this->container['AvatarManager'] = $this->getMock('OCP\\IAvatarManager');
$this->container['Cache'] = $this->getMockBuilder('OC\\Cache\\File')->disableOriginalConstructor()->getMock();
$this->container['L10N'] = $this->getMock('OCP\\IL10N');
$this->container['L10N']->method('t')->will($this->returnArgument(0));
$this->container['UserManager'] = $this->getMock('OCP\\IUserManager');
$this->container['UserSession'] = $this->getMock('OCP\\IUserSession');
$this->container['Request'] = $this->getMock('OCP\\IRequest');
$this->container['UserFolder'] = $this->getMock('OCP\\Files\\Folder');
$this->container['Logger'] = $this->getMock('OCP\\ILogger');
$this->avatarMock = $this->getMock('OCP\\IAvatar');
$this->userMock = $this->getMock('OCP\\IUser');
$this->avatarController = $this->container['AvatarController'];
// Configure userMock
$this->userMock->method('getDisplayName')->willReturn('displayName');
$this->userMock->method('getUID')->willReturn('userId');
$this->container['UserManager']->method('get')->willReturnMap([['userId', $this->userMock]]);
$this->container['UserSession']->method('getUser')->willReturn($this->userMock);
$this->avatarFile = $this->getMock('OCP\\Files\\File');
$this->avatarFile->method('getContnet')->willReturn('image data');
$this->avatarFile->method('getMimeType')->willReturn('image type');
$this->avatarFile->method('getEtag')->willReturn('my etag');
}
示例2: setUp
protected function setUp()
{
$this->shareManager = $this->getMockBuilder('OCP\\Share\\IManager')->disableOriginalConstructor()->getMock();
$this->groupManager = $this->getMock('OCP\\IGroupManager');
$this->userManager = $this->getMock('OCP\\IUserManager');
$this->request = $this->getMock('OCP\\IRequest');
$this->rootFolder = $this->getMock('OCP\\Files\\IRootFolder');
$this->urlGenerator = $this->getMock('OCP\\IURLGenerator');
$this->currentUser = $this->getMock('OCP\\IUser');
$this->currentUser->method('getUID')->willReturn('currentUser');
$this->ocs = new Share20OCS($this->shareManager, $this->groupManager, $this->userManager, $this->request, $this->rootFolder, $this->urlGenerator, $this->currentUser);
}
示例3: setUp
protected function setUp()
{
$this->shareManager = $this->getMockBuilder('OCP\\Share\\IManager')->disableOriginalConstructor()->getMock();
$this->shareManager->expects($this->any())->method('shareApiEnabled')->willReturn(true);
$this->groupManager = $this->getMock('OCP\\IGroupManager');
$this->userManager = $this->getMock('OCP\\IUserManager');
$this->request = $this->getMock('OCP\\IRequest');
$this->rootFolder = $this->getMock('OCP\\Files\\IRootFolder');
$this->urlGenerator = $this->getMock('OCP\\IURLGenerator');
$this->currentUser = $this->getMock('OCP\\IUser');
$this->currentUser->method('getUID')->willReturn('currentUser');
$this->l = $this->getMock('\\OCP\\IL10N');
$this->l->method('t')->will($this->returnCallback(function ($text, $parameters = []) {
return vsprintf($text, $parameters);
}));
$this->ocs = new Share20OCS($this->shareManager, $this->groupManager, $this->userManager, $this->request, $this->rootFolder, $this->urlGenerator, $this->currentUser, $this->l);
}
示例4: testMultiBucketConfigFirstFallBackSingle
public function testMultiBucketConfigFirstFallBackSingle()
{
$this->config->expects($this->at(0))->method('getSystemValue')->with($this->equalTo('objectstore_multibucket'))->willReturn('');
$this->config->expects($this->at(1))->method('getSystemValue')->with($this->equalTo('objectstore'))->willReturn(['class' => 'Test\\Files\\Mount\\FakeObjectStore']);
$this->user->method('getUID')->willReturn('uid');
$this->loader->expects($this->never())->method($this->anything());
$mount = $this->provider->getHomeMountForUser($this->user, $this->loader);
$this->assertInstanceOf('OC\\Files\\Mount\\MountPoint', $mount);
}