當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。