当前位置: 首页>>代码示例>>PHP>>正文


PHP IUser::method方法代码示例

本文整理汇总了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');
 }
开发者ID:farukuzun,项目名称:core-1,代码行数:30,代码来源:avatarcontrollertest.php

示例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);
 }
开发者ID:ZverAleksey,项目名称:core,代码行数:12,代码来源:share20ocstest.php

示例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);
 }
开发者ID:stweil,项目名称:owncloud-core,代码行数:17,代码来源:share20ocstest.php

示例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);
 }
开发者ID:rchicoli,项目名称:owncloud-core,代码行数:9,代码来源:ObjectHomeMountProviderTest.php


注:本文中的OCP\IUser::method方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。