當前位置: 首頁>>代碼示例>>PHP>>正文


PHP IRequest::method方法代碼示例

本文整理匯總了PHP中OCP\IRequest::method方法的典型用法代碼示例。如果您正苦於以下問題:PHP IRequest::method方法的具體用法?PHP IRequest::method怎麽用?PHP IRequest::method使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在OCP\IRequest的用法示例。


在下文中一共展示了IRequest::method方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: testAddGroupWithSpecialChar

 public function testAddGroupWithSpecialChar()
 {
     $this->request->method('getParam')->with('groupid')->willReturn('Iñtërnâtiônàlizætiøn');
     $this->groupManager->method('groupExists')->with('Iñtërnâtiônàlizætiøn')->willReturn(false);
     $this->groupManager->expects($this->once())->method('createGroup')->with('Iñtërnâtiônàlizætiøn');
     $result = $this->api->addGroup([]);
     $this->assertInstanceOf('OC_OCS_Result', $result);
     $this->assertTrue($result->succeeded());
 }
開發者ID:kenwi,項目名稱:core,代碼行數:9,代碼來源:groupstest.php

示例2: testCreateShareGroup

 public function testCreateShareGroup()
 {
     $share = $this->getMock('\\OC\\Share20\\IShare');
     $this->shareManager->method('newShare')->willReturn($share);
     $ocs = $this->getMockBuilder('OCA\\Files_Sharing\\API\\Share20OCS')->setConstructorArgs([$this->shareManager, $this->groupManager, $this->userManager, $this->request, $this->rootFolder, $this->urlGenerator, $this->currentUser])->setMethods(['formatShare'])->getMock();
     $this->request->method('getParam')->will($this->returnValueMap([['path', null, 'valid-path'], ['permissions', null, \OCP\Constants::PERMISSION_ALL], ['shareType', '-1', \OCP\Share::SHARE_TYPE_GROUP], ['shareWith', null, 'validGroup']]));
     $userFolder = $this->getMock('\\OCP\\Files\\Folder');
     $this->rootFolder->expects($this->once())->method('getUserFolder')->with('currentUser')->willReturn($userFolder);
     $path = $this->getMock('\\OCP\\Files\\Folder');
     $userFolder->expects($this->once())->method('get')->with('valid-path')->willReturn($path);
     $group = $this->getMock('\\OCP\\IGroup');
     $this->groupManager->method('groupExists')->with('validGroup')->willReturn(true);
     $this->groupManager->method('get')->with('validGroup')->willReturn($group);
     $share->method('setPath')->with($path);
     $share->method('setPermissions')->with(\OCP\Constants::PERMISSION_ALL);
     $share->method('setShareType')->with(\OCP\Share::SHARE_TYPE_GROUP);
     $share->method('setSharedWith')->with($group);
     $share->method('setSharedBy')->with($this->currentUser);
     $expected = new \OC_OCS_Result();
     $result = $ocs->createShare();
     $this->assertEquals($expected->getMeta(), $result->getMeta());
     $this->assertEquals($expected->getData(), $result->getData());
 }
開發者ID:gcstang,項目名稱:core,代碼行數:23,代碼來源:share20ocstest.php


注:本文中的OCP\IRequest::method方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。